X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;ds=sidebyside;f=3rdparty%2Fmodules%2Fstdlib%2Fspec%2Ffunctions%2Fgetparam_spec.rb;h=3a3cc274e4e49d81da1bd4b7d2562abbd463e5d4;hb=33b214debfd84ce19c5c971d8b9c769a765571ca;hp=522ed3b84050de68ca29c7878f2fc3c799e8c5cc;hpb=6963202b4b62c2816655ac9532521b018fdf83bd;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/stdlib/spec/functions/getparam_spec.rb b/3rdparty/modules/stdlib/spec/functions/getparam_spec.rb old mode 100755 new mode 100644 index 522ed3b84..3a3cc274e --- a/3rdparty/modules/stdlib/spec/functions/getparam_spec.rb +++ b/3rdparty/modules/stdlib/spec/functions/getparam_spec.rb @@ -2,11 +2,11 @@ require 'spec_helper' describe 'getparam' do it { is_expected.not_to eq(nil) } - it { is_expected.to run.with_params().and_raise_error(ArgumentError, /Must specify a reference/) } - it { is_expected.to run.with_params('User[one]').and_raise_error(ArgumentError, /Must specify name of a parameter/) } - it { is_expected.to run.with_params('User[one]', 2).and_raise_error(ArgumentError, /Must specify name of a parameter/) } - it { is_expected.to run.with_params('User[one]', []).and_raise_error(ArgumentError, /Must specify name of a parameter/) } - it { is_expected.to run.with_params('User[one]', {}).and_raise_error(ArgumentError, /Must specify name of a parameter/) } + it { is_expected.to run.with_params.and_raise_error(ArgumentError, %r{Must specify a reference}) } + it { is_expected.to run.with_params('User[one]').and_raise_error(ArgumentError, %r{Must specify name of a parameter}) } + it { is_expected.to run.with_params('User[one]', 2).and_raise_error(ArgumentError, %r{Must specify name of a parameter}) } + it { is_expected.to run.with_params('User[one]', []).and_raise_error(ArgumentError, %r{Must specify name of a parameter}) } + it { is_expected.to run.with_params('User[one]', {}).and_raise_error(ArgumentError, %r{Must specify name of a parameter}) } describe 'when compared against a user resource with no params' do let(:pre_condition) { 'user { "one": }' } @@ -30,6 +30,5 @@ describe 'getparam' do it { is_expected.to run.with_params('User[三]', 'ensure').and_return('present') } it { is_expected.to run.with_params('User[ƒốưř]', 'ensure').and_return('present') } - end end