X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Fstdlib%2Fspec%2Ffunctions%2Fmerge_spec.rb;fp=3rdparty%2Fmodules%2Fstdlib%2Fspec%2Ffunctions%2Fmerge_spec.rb;h=25e2658f6e7044ecfae2986ac3ab794317e915fc;hb=131e09855e065be940e104d9ab0f18940cc76257;hp=3b2e3ef4e05fd6ffbd51f8c6d63dcd1e4f3006e1;hpb=407d322498f4fde815abf381007fbecfe5c10b2b;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/stdlib/spec/functions/merge_spec.rb b/3rdparty/modules/stdlib/spec/functions/merge_spec.rb old mode 100755 new mode 100644 index 3b2e3ef4e..25e2658f6 --- a/3rdparty/modules/stdlib/spec/functions/merge_spec.rb +++ b/3rdparty/modules/stdlib/spec/functions/merge_spec.rb @@ -2,9 +2,9 @@ require 'spec_helper' describe 'merge' 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({}, 'two').and_raise_error(Puppet::ParseError, /unexpected argument type String/) } - it { is_expected.to run.with_params({}, 1).and_raise_error(Puppet::ParseError, /unexpected argument type (Fixnum|Integer)/) } + 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({}, 'two').and_raise_error(Puppet::ParseError, %r{unexpected argument type String}) } + it { is_expected.to run.with_params({}, 1).and_raise_error(Puppet::ParseError, %r{unexpected argument type (Fixnum|Integer)}) } it { pending 'should not special case this' is_expected.to run.with_params({}).and_return({}) @@ -14,12 +14,12 @@ describe 'merge' do describe 'should accept empty strings as puppet undef' do it { is_expected.to run.with_params({}, '').and_return({}) } end - it { is_expected.to run.with_params({ 'key' => 'value' }, {}).and_return({ 'key' => 'value' }) } - it { is_expected.to run.with_params({}, { 'key' => 'value' }).and_return({ 'key' => 'value' }) } - it { is_expected.to run.with_params({ 'key' => 'value1' }, { 'key' => 'value2' }).and_return({ 'key' => 'value2' }) } + it { is_expected.to run.with_params({ 'key' => 'value' }, {}).and_return('key' => 'value') } + it { is_expected.to run.with_params({}, 'key' => 'value').and_return('key' => 'value') } + it { is_expected.to run.with_params({ 'key' => 'value1' }, 'key' => 'value2').and_return('key' => 'value2') } it { is_expected.to run \ - .with_params({ 'key1' => 'value1' }, { 'key2' => 'value2' }, { 'key3' => 'value3' }) \ - .and_return({ 'key1' => 'value1', 'key2' => 'value2', 'key3' => 'value3' }) + .with_params({ 'key1' => 'value1' }, { 'key2' => 'value2' }, 'key3' => 'value3') \ + .and_return('key1' => 'value1', 'key2' => 'value2', 'key3' => 'value3') } end