From cc4d6586d420f4beea1eeef85cfe7a28f8e493ac Mon Sep 17 00:00:00 2001 From: Bryan Kearney Date: Thu, 12 Feb 2009 09:32:01 -0500 Subject: Bug #1948: Added patch by jab to support the correct ins syntax. Updated the test cases as well --- spec/unit/provider/augeas/augeas.rb | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'spec/unit') diff --git a/spec/unit/provider/augeas/augeas.rb b/spec/unit/provider/augeas/augeas.rb index 1bbf18f83..4bc1814e5 100644 --- a/spec/unit/provider/augeas/augeas.rb +++ b/spec/unit/provider/augeas/augeas.rb @@ -206,30 +206,31 @@ describe provider_class do @augeas.expects(:save).returns(true) @provider.execute_changes.should == :executed end - - it "should handle insert commands" do - command = [["insert", "/Jar/Jar"]] + + + it "should handle ins commands with before" do + command = [["ins", "Binks", "before", "/Jar/Jar"]] context = "/foo" @resource.expects(:[]).times(2).returns(command).then.returns(context) - @augeas.expects(:insert).with("/foo/Jar/Jar") + @augeas.expects(:insert).with("/foo/Jar/Jar", "Binks", true) @augeas.expects(:save).returns(true) @provider.execute_changes.should == :executed - end - - it "should handle ins commands" do - command = [["ins", "/Jar/Jar"]] + end + + it "should handle ins commands with before" do + command = [["ins", "Binks", "after", "/Jar/Jar"]] context = "/foo" @resource.expects(:[]).times(2).returns(command).then.returns(context) - @augeas.expects(:insert).with("/foo/Jar/Jar") + @augeas.expects(:insert).with("/foo/Jar/Jar", "Binks", false) @augeas.expects(:save).returns(true) @provider.execute_changes.should == :executed - end + end it "should handle multiple commands" do - command = [["ins", "/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") + @augeas.expects(:insert).with("/foo/Jar/Jar", "Binks", false) @augeas.expects(:clear).with("/foo/Jar/Jar") @augeas.expects(:save).returns(true) @provider.execute_changes.should == :executed -- cgit