Created
May 18, 2011 21:48
-
-
Save domcleal/979650 to your computer and use it in GitHub Desktop.
Stubbing in augeas spec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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