summaryrefslogtreecommitdiffstats
path: root/spec/unit/provider/augeas
diff options
context:
space:
mode:
authorSteve Nielson <steve@nielsenhq.com>2010-11-22 14:58:31 -0500
committerMatt Robinson <matt@puppetlabs.com>2010-12-02 10:31:08 -0800
commit094a5c85fc9b4b1bd00f14193abdf23839905dc7 (patch)
tree3fc0b8922dd77da13a674d18fc8dcc8b0b38158f /spec/unit/provider/augeas
parent53bb805f118ccaca5598e60afadfa6b777410a0f (diff)
downloadpuppet-094a5c85fc9b4b1bd00f14193abdf23839905dc7.tar.gz
puppet-094a5c85fc9b4b1bd00f14193abdf23839905dc7.tar.xz
puppet-094a5c85fc9b4b1bd00f14193abdf23839905dc7.zip
(#5211) Added patch and tests for checking the size of the arrary which is returned
Diffstat (limited to 'spec/unit/provider/augeas')
-rw-r--r--spec/unit/provider/augeas/augeas_spec.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/unit/provider/augeas/augeas_spec.rb b/spec/unit/provider/augeas/augeas_spec.rb
index 07b632083..0cedbdbc3 100644
--- a/spec/unit/provider/augeas/augeas_spec.rb
+++ b/spec/unit/provider/augeas/augeas_spec.rb
@@ -316,6 +316,30 @@ describe provider_class do
provider.stubs(:get_augeas_version).returns("0.3.5")
provider.need_to_run?.should == false
end
+
+ #Ticket 5211 testing
+ it "should return true when a size != the provided value" do
+ resource = stub("resource")
+ resource.stubs(:[]).returns(false).then.returns("match path size != 17").then.returns("")
+ provider = provider_class.new(resource)
+ augeas_stub = stub("augeas", :match => ["set", "of", "values"])
+ augeas_stub.stubs("close")
+ provider.aug= augeas_stub
+ provider.stubs(:get_augeas_version).returns("0.3.5")
+ provider.need_to_run?.should == true
+ end
+
+ #Ticket 5211 testing
+ it "should return false when a size doeas equal the provided value" do
+ resource = stub("resource")
+ resource.stubs(:[]).returns(false).then.returns("match path size != 3").then.returns("")
+ provider = provider_class.new(resource)
+ augeas_stub = stub("augeas", :match => ["set", "of", "values"])
+ augeas_stub.stubs("close")
+ provider.aug= augeas_stub
+ provider.stubs(:get_augeas_version).returns("0.3.5")
+ provider.need_to_run?.should == false
+ end
end
describe "augeas execution integration" do