From 6991b28db1fd216f8fa5a29e2313f207a6d14537 Mon Sep 17 00:00:00 2001 From: David Schmitt Date: Sun, 14 Aug 2016 13:46:32 +0100 Subject: (MAINT) Update ensure_resource specs This updates the test to match the new behaviour in puppet 4.6.0 --- spec/functions/ensure_resource_spec.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'spec') diff --git a/spec/functions/ensure_resource_spec.rb b/spec/functions/ensure_resource_spec.rb index 9a17f5b..d552f4e 100755 --- a/spec/functions/ensure_resource_spec.rb +++ b/spec/functions/ensure_resource_spec.rb @@ -4,7 +4,12 @@ describe 'ensure_resource' do it { is_expected.not_to eq(nil) } it { is_expected.to run.with_params().and_raise_error(ArgumentError, /Must specify a type/) } it { is_expected.to run.with_params('type').and_raise_error(ArgumentError, /Must specify a title/) } - it { is_expected.to run.with_params('type', 'title', {}, 'extras').and_raise_error(Puppet::ParseError) } + if Puppet.version.to_f >= 4.6 + it { is_expected.to run.with_params('type', 'title', {}, 'extras').and_raise_error(ArgumentError) } + else + it { is_expected.to run.with_params('type', 'title', {}, 'extras').and_raise_error(Puppet::ParseError) } + end + it { pending("should not accept numbers as arguments") is_expected.to run.with_params(1,2,3).and_raise_error(Puppet::ParseError) -- cgit v1.2.3