summaryrefslogtreecommitdiff
path: root/spec/functions/ensure_packages_spec.rb
diff options
context:
space:
mode:
authorAdrien Thebo <git@somethingsinistral.net>2014-01-15 11:04:03 -0800
committerAdrien Thebo <git@somethingsinistral.net>2014-01-15 11:04:03 -0800
commit75341f01d921352caf98caaff7ac30dcb6b626ed (patch)
treea698b774a399800ad7570357d714777afe26aa5a /spec/functions/ensure_packages_spec.rb
parent686a05aea20eb45560698caaad5c9f2f01821ae6 (diff)
(maint) Update ensure_package specs to confirm expected behavior
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.
Diffstat (limited to 'spec/functions/ensure_packages_spec.rb')
-rw-r--r--spec/functions/ensure_packages_spec.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/spec/functions/ensure_packages_spec.rb b/spec/functions/ensure_packages_spec.rb
index f6272af..a13c282 100644
--- a/spec/functions/ensure_packages_spec.rb
+++ b/spec/functions/ensure_packages_spec.rb
@@ -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