summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDavid Schmitt <david.schmitt@puppet.com>2016-08-14 13:46:32 +0100
committerDavid Schmitt <david.schmitt@puppet.com>2016-08-14 13:50:43 +0100
commit6991b28db1fd216f8fa5a29e2313f207a6d14537 (patch)
tree0884c306535cf444735353d9c4542772a587ea20 /spec
parent1d9d2c02d6669d4a6219140ae7ff3648a30c89cf (diff)
(MAINT) Update ensure_resource specs
This updates the test to match the new behaviour in puppet 4.6.0
Diffstat (limited to 'spec')
-rwxr-xr-xspec/functions/ensure_resource_spec.rb7
1 files changed, 6 insertions, 1 deletions
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)