From: Adrien Thebo Date: Wed, 15 Jan 2014 19:04:03 +0000 (-0800) Subject: (maint) Update ensure_package specs to confirm expected behavior X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=75341f01d921352caf98caaff7ac30dcb6b626ed;p=puppet-stdlib.git (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. --- 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