summaryrefslogtreecommitdiffstats
path: root/spec/unit
diff options
context:
space:
mode:
authorBryan Kearney <bkearney@redhat.com>2009-02-12 09:32:01 -0500
committerJames Turnbull <james@lovedthanlost.net>2009-02-13 02:08:49 +1100
commitcc4d6586d420f4beea1eeef85cfe7a28f8e493ac (patch)
tree213a5b3d4b7234cc0fc9b8ecfff5d9f03d65cf8a /spec/unit
parent5e35166f1b7219d470916d1ee7a4e6852afaf1f9 (diff)
downloadpuppet-cc4d6586d420f4beea1eeef85cfe7a28f8e493ac.tar.gz
puppet-cc4d6586d420f4beea1eeef85cfe7a28f8e493ac.tar.xz
puppet-cc4d6586d420f4beea1eeef85cfe7a28f8e493ac.zip
Bug #1948: Added patch by jab to support the correct ins syntax. Updated the test cases as well
Diffstat (limited to 'spec/unit')
-rw-r--r--spec/unit/provider/augeas/augeas.rb25
1 files changed, 13 insertions, 12 deletions
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