Skip to content

Instantly share code, notes, and snippets.

@domcleal
Created May 18, 2011 21:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save domcleal/979650 to your computer and use it in GitHub Desktop.
Save domcleal/979650 to your computer and use it in GitHub Desktop.
Stubbing in augeas spec
diff --git a/spec/unit/provider/augeas/augeas_spec.rb b/spec/unit/provider/augeas/augeas_spec.rb
index 693e33e..b8aade2 100755
--- a/spec/unit/provider/augeas/augeas_spec.rb
+++ b/spec/unit/provider/augeas/augeas_spec.rb
@@ -373,8 +373,7 @@ describe provider_class do
augeas_stub = stub("augeas")
augeas_stub.expects("set").with("/augeas/save", "newfile")
augeas_stub.expects("save").returns(true)
- augeas_stub.expects("get").with("/augeas/events/saved").returns([])
- augeas_stub.expects("match").with("/augeas/events/saved").returns([])
+ augeas_stub.stubs("match").with("/augeas/events/saved").returns([])
augeas_stub.stubs("close")
provider.aug= augeas_stub
@@ -390,6 +389,7 @@ describe provider_class do
@resource = stub("resource")
@provider = provider_class.new(@resource)
@augeas = stub("augeas")
+ @augeas.stubs(:match).with("/augeas/events/saved")
@provider.aug= @augeas
@provider.stubs(:get_augeas_version).returns("0.3.5")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment