From 75341f01d921352caf98caaff7ac30dcb6b626ed Mon Sep 17 00:00:00 2001 From: Adrien Thebo Date: Wed, 15 Jan 2014 11:04:03 -0800 Subject: (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. --- spec/functions/ensure_packages_spec.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'spec/functions/ensure_packages_spec.rb') 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 -- cgit v1.2.3