X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Fstdlib%2Fspec%2Ffunctions%2Fshell_escape_spec.rb;fp=3rdparty%2Fmodules%2Fstdlib%2Fspec%2Ffunctions%2Fshell_escape_spec.rb;h=ed63bc384d4f609c284e57f38c120436501bd715;hb=131e09855e065be940e104d9ab0f18940cc76257;hp=77917ddb80dff029b5b0cb5bef93db79d6d2bd6f;hpb=407d322498f4fde815abf381007fbecfe5c10b2b;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/stdlib/spec/functions/shell_escape_spec.rb b/3rdparty/modules/stdlib/spec/functions/shell_escape_spec.rb index 77917ddb8..ed63bc384 100644 --- a/3rdparty/modules/stdlib/spec/functions/shell_escape_spec.rb +++ b/3rdparty/modules/stdlib/spec/functions/shell_escape_spec.rb @@ -4,8 +4,8 @@ describe 'shell_escape' 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,12 +16,14 @@ describe 'shell_escape' do describe 'escaping' 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('\~\`\!@\#\$\%\^\&\*\(\)_\+-\=\[\]\\\\\{\}\|\;\\\':\",./\<\>\?') + } end - context 'should run with UTF8 and double byte characters' do - it { is_expected.to run.with_params('スペー スを含むテ キスト').and_return('\\ス\\ペ\\ー\\ \\ス\\を\\含\\む\\テ\\ \\ \\キ\\ス\\ト') } - it { is_expected.to run.with_params('μťƒ 8 ŧĕχť').and_return('\\μ\\ť\\ƒ\\ 8\\ \\ \\ŧ\\ĕ\\χ\\ť') } + context 'with UTF8 and double byte characters' do + it { is_expected.to run.with_params('スペー スを含むテ キスト').and_return('\\ス\\ペ\\ー\\ \\ス\\を\\含\\む\\テ\\ \\ \\キ\\ス\\ト') } + it { is_expected.to run.with_params('μťƒ 8 ŧĕχť').and_return('\\μ\\ť\\ƒ\\ 8\\ \\ \\ŧ\\ĕ\\χ\\ť') } end end