X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Fstdlib%2Fspec%2Ffunctions%2Fsort_spec.rb;h=0e6e8e6e6f5aafe99c267f7b091405cc2daefbf3;hb=30caaa85aed7015ca0d77216bff175eebd917eb7;hp=9abd039c13e7fd0e5bdcc62d35983be590bb8143;hpb=6963202b4b62c2816655ac9532521b018fdf83bd;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/stdlib/spec/functions/sort_spec.rb b/3rdparty/modules/stdlib/spec/functions/sort_spec.rb old mode 100755 new mode 100644 index 9abd039c1..0e6e8e6e6 --- a/3rdparty/modules/stdlib/spec/functions/sort_spec.rb +++ b/3rdparty/modules/stdlib/spec/functions/sort_spec.rb @@ -1,13 +1,22 @@ require 'spec_helper' -describe 'sort' do +describe 'sort', :if => Puppet::Util::Package.versioncmp(Puppet.version, '6.0.0') < 0 do describe 'signature validation' do it { is_expected.not_to eq(nil) } - it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) } - it { is_expected.to run.with_params([], 'extra').and_raise_error(Puppet::ParseError, /wrong number of arguments/i) } - it { pending('stricter input checking'); is_expected.to run.with_params({}).and_raise_error(Puppet::ParseError, /requires string or array/) } - it { pending('stricter input checking'); is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError, /requires string or array/) } - it { pending('stricter input checking'); is_expected.to run.with_params(true).and_raise_error(Puppet::ParseError, /requires string or array/) } + it { is_expected.to run.with_params.and_raise_error(Puppet::ParseError, %r{wrong number of arguments}i) } + it { is_expected.to run.with_params([], 'extra').and_raise_error(Puppet::ParseError, %r{wrong number of arguments}i) } + it { + pending('stricter input checking') + is_expected.to run.with_params({}).and_raise_error(Puppet::ParseError, %r{requires string or array}) + } + it { + pending('stricter input checking') + is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError, %r{requires string or array}) + } + it { + pending('stricter input checking') + is_expected.to run.with_params(true).and_raise_error(Puppet::ParseError, %r{requires string or array}) + } end context 'when called with an array' do @@ -21,4 +30,8 @@ describe 'sort' do it { is_expected.to run.with_params('a').and_return('a') } it { is_expected.to run.with_params('cbda').and_return('abcd') } end + + context 'when called with a number' do + it { is_expected.to run.with_params('9478').and_return('4789') } + end end