]> gitweb.fluxo.info Git - puppet-stdlib.git/commitdiff
(maint) Update ensure_package specs to confirm expected behavior
authorAdrien Thebo <git@somethingsinistral.net>
Wed, 15 Jan 2014 19:04:03 +0000 (11:04 -0800)
committerAdrien Thebo <git@somethingsinistral.net>
Wed, 15 Jan 2014 19:04:03 +0000 (11:04 -0800)
The previous behavior of the tests checked the behavior of the
underlying functions library when called with no arguments; this commit
updates the tests to conform to the functions API and test what happens
when a function is called with no args.

spec/functions/ensure_packages_spec.rb

index f6272af0e7548c4f0a947d9758d296276b56c397..a13c28216e99a258495eef5129d8b4f53259c403 100644 (file)
@@ -8,10 +8,13 @@ describe 'ensure_packages' do
 
   describe 'argument handling' do
     it 'fails with no arguments' do
-      should run.with_params().and_raise_error(Puppet::ParseError)
+      expect {
+        scope.function_ensure_packages([])
+      }.to raise_error(Puppet::ParseError, /0 for 1/)
     end
-    it 'requires an array' do
-      lambda { scope.function_ensure_packages([['foo']]) }.should_not raise_error
+
+    it 'accepts an array of values' do
+      scope.function_ensure_packages([['foo']])
     end
 
     it 'accepts a single package name as a string' do