summaryrefslogtreecommitdiff
path: root/spec/functions/ensure_resource_spec.rb
diff options
context:
space:
mode:
authorTP Honey <tphoney@users.noreply.github.com>2016-08-15 10:44:14 +0100
committerGitHub <noreply@github.com>2016-08-15 10:44:14 +0100
commitfafe8300a4157a71a59df655a8c52ada8bfaf3ee (patch)
tree0884c306535cf444735353d9c4542772a587ea20 /spec/functions/ensure_resource_spec.rb
parent1d9d2c02d6669d4a6219140ae7ff3648a30c89cf (diff)
parent6991b28db1fd216f8fa5a29e2313f207a6d14537 (diff)
Merge pull request #635 from DavidS/fix-ensure_resource-expectations
(MAINT) Update ensure_resource specs
Diffstat (limited to 'spec/functions/ensure_resource_spec.rb')
-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)