summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Putnam <putnam.eric@gmail.com>2017-07-11 15:43:37 -0700
committerEric Putnam <putnam.eric@gmail.com>2017-07-11 16:52:00 -0700
commit715c40dc9083068598387ab67396136e87eb553d (patch)
tree353dc4ca3c7290ead7d85299c859882d310cac84
parent3eee345aa2cb697e8791069ffe96299db6a28f8e (diff)
(MODULES-5187) fix spec tests for puppet 5 changes
-rw-r--r--spec/aliases/integer_spec.rb6
-rwxr-xr-xspec/functions/merge_spec.rb2
2 files changed, 6 insertions, 2 deletions
diff --git a/spec/aliases/integer_spec.rb b/spec/aliases/integer_spec.rb
index 8cb4658..aec9fd6 100644
--- a/spec/aliases/integer_spec.rb
+++ b/spec/aliases/integer_spec.rb
@@ -22,7 +22,11 @@ if Puppet::Util::Package.versioncmp(Puppet.version, '4.5.0') >= 0
[ "foo\nbar", true, 'true', false, 'false', 'iAmAString', '1test', '1 test', 'test 1', 'test 1 test', {}, { 'key' => 'value' }, { 1=> 2 }, '', :undef , 'x', 3.7, '3.7',-3.7, '-342.2315e-12' ].each do |value|
describe value.inspect do
let(:params) {{ value: value }}
- it { is_expected.to compile.and_raise_error(/parameter 'value' expects a value of type Integer, Pattern(\[.*\]+)?, or Array/) }
+ if Gem::Version.new(Puppet.version) >= Gem::Version.new('5.0.0')
+ it { is_expected.to compile.and_raise_error(/parameter 'value' expects a Stdlib::Compat::Integer = Variant\[Integer, Pattern\[.*\], Array\[.*\]\] value/) }
+ else
+ it { is_expected.to compile.and_raise_error(/parameter 'value' expects a value of type Integer, Pattern(\[.*\]+)?, or Array/) }
+ end
end
end
end
diff --git a/spec/functions/merge_spec.rb b/spec/functions/merge_spec.rb
index 7b53363..3b2e3ef 100755
--- a/spec/functions/merge_spec.rb
+++ b/spec/functions/merge_spec.rb
@@ -4,7 +4,7 @@ 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/) }
+ it { is_expected.to run.with_params({}, 1).and_raise_error(Puppet::ParseError, /unexpected argument type (Fixnum|Integer)/) }
it {
pending 'should not special case this'
is_expected.to run.with_params({}).and_return({})