summaryrefslogtreecommitdiffstats
path: root/spec/unit/provider/augeas/augeas.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/provider/augeas/augeas.rb')
-rw-r--r--spec/unit/provider/augeas/augeas.rb17
1 files changed, 13 insertions, 4 deletions
diff --git a/spec/unit/provider/augeas/augeas.rb b/spec/unit/provider/augeas/augeas.rb
index 4bc1814e5..2def0d0c4 100644
--- a/spec/unit/provider/augeas/augeas.rb
+++ b/spec/unit/provider/augeas/augeas.rb
@@ -209,7 +209,7 @@ describe provider_class do
it "should handle ins commands with before" do
- command = [["ins", "Binks", "before", "/Jar/Jar"]]
+ command = [["ins", "Binks", "before /Jar/Jar"]]
context = "/foo"
@resource.expects(:[]).times(2).returns(command).then.returns(context)
@augeas.expects(:insert).with("/foo/Jar/Jar", "Binks", true)
@@ -218,16 +218,25 @@ describe provider_class do
end
it "should handle ins commands with before" do
- command = [["ins", "Binks", "after", "/Jar/Jar"]]
+ command = [["ins", "Binks", "after /Jar/Jar"]]
context = "/foo"
@resource.expects(:[]).times(2).returns(command).then.returns(context)
@augeas.expects(:insert).with("/foo/Jar/Jar", "Binks", false)
@augeas.expects(:save).returns(true)
@provider.execute_changes.should == :executed
- end
+ end
+
+ it "should handle ins with no context" do
+ command = [["ins", "Binks", "after /Jar/Jar"]]
+ context = "" # this is the default
+ @resource.expects(:[]).times(2).returns(command).then.returns(context)
+ @augeas.expects(:insert).with("/Jar/Jar", "Binks", false)
+ @augeas.expects(:save).returns(true)
+ @provider.execute_changes.should == :executed
+ end
it "should handle multiple commands" do
- command = [["ins", "Binks", "after", "/Jar/Jar"], ["clear", "/Jar/Jar"]]
+ command = [["ins", "Binks", "after /Jar/Jar"], ["clear", "/Jar/Jar"]]
context = "/foo"
@resource.expects(:[]).times(2).returns(command).then.returns(context)
@augeas.expects(:insert).with("/foo/Jar/Jar", "Binks", false)