X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Fstdlib%2Fspec%2Ffunctions%2Fshell_split_spec.rb;h=4a72cab2f1f0a5c33287bc9849fd65f28dbaa7d3;hb=59812388abf4638d6065ffda934d1866af902302;hp=f8f9c90900e235cf8ef956a4a704efc2835e6bda;hpb=6963202b4b62c2816655ac9532521b018fdf83bd;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/stdlib/spec/functions/shell_split_spec.rb b/3rdparty/modules/stdlib/spec/functions/shell_split_spec.rb index f8f9c9090..4a72cab2f 100644 --- a/3rdparty/modules/stdlib/spec/functions/shell_split_spec.rb +++ b/3rdparty/modules/stdlib/spec/functions/shell_split_spec.rb @@ -4,8 +4,8 @@ describe 'shell_split' do it { is_expected.not_to eq(nil) } describe 'signature validation' do - it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) } - it { is_expected.to run.with_params('foo', 'bar').and_raise_error(Puppet::ParseError, /wrong number of arguments/i) } + 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('foo', 'bar').and_raise_error(Puppet::ParseError, %r{wrong number of arguments}i) } end describe 'stringification' do @@ -16,14 +16,18 @@ describe 'shell_split' do describe 'shell line spliting' do it { is_expected.to run.with_params('foo').and_return(['foo']) } it { is_expected.to run.with_params('foo bar').and_return(['foo', 'bar']) } - it { is_expected.to run.with_params('\~\`\!@\#\$\%\^\&\*\(\)_\+-\=\[\]\\\\\{\}\|\;\\\':\",./\<\>\?') - .and_return(['~`!@#$%^&*()_+-=[]\{}|;\':",./<>?']) } - it { is_expected.to run.with_params('\~\`\!@\#\$ \%\^\&\*\(\)_\+-\= \[\]\\\\\{\}\|\;\\\':\" ,./\<\>\?') - .and_return(['~`!@#$', '%^&*()_+-=', '[]\{}|;\':"', ',./<>?']) } + it { + is_expected.to run.with_params('\~\`\!@\#\$\%\^\&\*\(\)_\+-\=\[\]\\\\\{\}\|\;\\\':\",./\<\>\?') + .and_return(['~`!@#$%^&*()_+-=[]\{}|;\':",./<>?']) + } + it { + is_expected.to run.with_params('\~\`\!@\#\$ \%\^\&\*\(\)_\+-\= \[\]\\\\\{\}\|\;\\\':\" ,./\<\>\?') + .and_return(['~`!@#$', '%^&*()_+-=', '[]\{}|;\':"', ',./<>?']) + } - context 'should run with UTF8 and double byte characters' do - it { is_expected.to run.with_params('\\μ\\ť\\ƒ 8 \\ŧ\\ĕ\\χ\\ť').and_return(['μťƒ', '8', 'ŧĕχť']) } - it { is_expected.to run.with_params('\\ス\\ペ\\ー \\ス\\を\\含\\む\\テ \\ \\キ\\ス\\ト').and_return(['スペー', 'スを含むテ', ' キスト']) } + context 'with UTF8 and double byte characters' do + it { is_expected.to run.with_params('\\μ\\ť\\ƒ 8 \\ŧ\\ĕ\\χ\\ť').and_return(['μťƒ', '8', 'ŧĕχť']) } + it { is_expected.to run.with_params('\\ス\\ペ\\ー \\ス\\を\\含\\む\\テ \\ \\キ\\ス\\ト').and_return(['スペー', 'スを含むテ', ' キスト']) } end end end