summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/functions/ensure_packages_spec.rb14
1 files changed, 9 insertions, 5 deletions
diff --git a/spec/functions/ensure_packages_spec.rb b/spec/functions/ensure_packages_spec.rb
index 6fd56d5..a13c282 100644
--- a/spec/functions/ensure_packages_spec.rb
+++ b/spec/functions/ensure_packages_spec.rb
@@ -8,13 +8,17 @@ 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 'fails when given a string' do
- should run.with_params('foo').and_raise_error(Puppet::ParseError)
+
+ it 'accepts a single package name as a string' do
+ scope.function_ensure_packages(['foo'])
end
end