X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Fstdlib%2Fspec%2Ffunctions%2Fflatten_spec.rb;h=0b08f35fd3131b96e66791b3ca276cc25b6456ac;hb=30caaa85aed7015ca0d77216bff175eebd917eb7;hp=b80f3c5ad0b3d463dcf5d25344715198a3e0258f;hpb=6963202b4b62c2816655ac9532521b018fdf83bd;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/stdlib/spec/functions/flatten_spec.rb b/3rdparty/modules/stdlib/spec/functions/flatten_spec.rb old mode 100755 new mode 100644 index b80f3c5ad..0b08f35fd --- a/3rdparty/modules/stdlib/spec/functions/flatten_spec.rb +++ b/3rdparty/modules/stdlib/spec/functions/flatten_spec.rb @@ -1,15 +1,16 @@ require 'spec_helper' -describe 'flatten' do +describe 'flatten', :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) } - it { is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError) } - it { is_expected.to run.with_params('one').and_raise_error(Puppet::ParseError) } + it { is_expected.to run.with_params.and_raise_error(Puppet::ParseError, %r{Wrong number of arguments}) } + it { is_expected.to run.with_params([], []).and_raise_error(Puppet::ParseError, %r{Wrong number of arguments}) } + it { is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError, %r{Requires array}) } + it { is_expected.to run.with_params('one').and_raise_error(Puppet::ParseError, %r{Requires array}) } + it { is_expected.to run.with_params([]).and_return([]) } it { is_expected.to run.with_params(['one']).and_return(['one']) } it { is_expected.to run.with_params([['one']]).and_return(['one']) } - it { is_expected.to run.with_params(["a","b","c","d","e","f","g"]).and_return(["a","b","c","d","e","f","g"]) } - it { is_expected.to run.with_params([["a","b",["c",["d","e"],"f","g"]]]).and_return(["a","b","c","d","e","f","g"]) } - it { is_expected.to run.with_params(["ã","β",["ĉ",["đ","ẽ","ƒ","ġ"]]]).and_return(["ã","β","ĉ","đ","ẽ","ƒ","ġ"]) } + it { is_expected.to run.with_params(['a', 'b', 'c', 'd', 'e', 'f', 'g']).and_return(['a', 'b', 'c', 'd', 'e', 'f', 'g']) } + it { is_expected.to run.with_params([['a', 'b', ['c', ['d', 'e'], 'f', 'g']]]).and_return(['a', 'b', 'c', 'd', 'e', 'f', 'g']) } + it { is_expected.to run.with_params(['ã', 'β', ['ĉ', ['đ', 'ẽ', 'ƒ', 'ġ']]]).and_return(['ã', 'β', 'ĉ', 'đ', 'ẽ', 'ƒ', 'ġ']) } end