diff options
author | Adrien Thebo <git@somethingsinistral.net> | 2014-01-15 11:04:03 -0800 |
---|---|---|
committer | Adrien Thebo <git@somethingsinistral.net> | 2014-01-15 11:04:03 -0800 |
commit | 75341f01d921352caf98caaff7ac30dcb6b626ed (patch) | |
tree | a698b774a399800ad7570357d714777afe26aa5a | |
parent | 686a05aea20eb45560698caaad5c9f2f01821ae6 (diff) | |
download | puppet-stdlib-75341f01d921352caf98caaff7ac30dcb6b626ed.tar.gz puppet-stdlib-75341f01d921352caf98caaff7ac30dcb6b626ed.tar.bz2 |
(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.
-rw-r--r-- | spec/functions/ensure_packages_spec.rb | 9 |
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 |