X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Fstdlib%2Fspec%2Ffunctions%2Fempty_spec.rb;h=695c8a5adeba1b77a15b791d3b25a32acdfbbae8;hb=30caaa85aed7015ca0d77216bff175eebd917eb7;hp=a3a25d6a00186039d27b67e1cef482dfb21dbb70;hpb=6963202b4b62c2816655ac9532521b018fdf83bd;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/stdlib/spec/functions/empty_spec.rb b/3rdparty/modules/stdlib/spec/functions/empty_spec.rb old mode 100755 new mode 100644 index a3a25d6a0..695c8a5ad --- a/3rdparty/modules/stdlib/spec/functions/empty_spec.rb +++ b/3rdparty/modules/stdlib/spec/functions/empty_spec.rb @@ -1,12 +1,13 @@ require 'spec_helper' -describe 'empty' do +describe 'empty', :if => Puppet::Util::Package.versioncmp(Puppet.version, '5.5.0') < 0 do it { is_expected.not_to eq(nil) } - it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError) } + it { is_expected.to run.with_params.and_raise_error(Puppet::ParseError, %r{Wrong number of arguments}) } it { - pending("Current implementation ignores parameters after the first.") + pending('Current implementation ignores parameters after the first.') is_expected.to run.with_params('one', 'two').and_raise_error(Puppet::ParseError) } + it { is_expected.to run.with_params(false).and_raise_error(Puppet::ParseError, %r{Requires either array, hash, string or integer}) } it { is_expected.to run.with_params(0).and_return(false) } it { is_expected.to run.with_params('').and_return(true) } it { is_expected.to run.with_params('one').and_return(false) } @@ -18,5 +19,5 @@ describe 'empty' do it { is_expected.to run.with_params(['one']).and_return(false) } it { is_expected.to run.with_params({}).and_return(true) } - it { is_expected.to run.with_params({'key' => 'value'}).and_return(false) } + it { is_expected.to run.with_params('key' => 'value').and_return(false) } end