diff options
author | Wilson McCoubrey <wilson@mccoubreys.co.uk> | 2017-03-16 13:42:03 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-16 13:42:03 +0000 |
commit | 60e9e0beb8f42937a03143b98dc9bcf51a5b6e2d (patch) | |
tree | dfbf6cb6ff835f684ee6a5c14da183badee29145 /spec/functions | |
parent | 2a7c2beddb76fbfc98121acc34b53f925d5232ad (diff) | |
parent | 318dcfaec6ba6d0e4af1e32e55ea20b721679537 (diff) |
Merge pull request #737 from domcleal/versioncmp
(MODULES-4528) Use versioncmp to check Puppet version for 4.10.x compat
Diffstat (limited to 'spec/functions')
-rw-r--r-- | spec/functions/deprecation_spec.rb | 2 | ||||
-rwxr-xr-x | spec/functions/ensure_resource_spec.rb | 2 | ||||
-rw-r--r-- | spec/functions/validate_legacy_spec.rb | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/spec/functions/deprecation_spec.rb b/spec/functions/deprecation_spec.rb index 8a65b69..bde4e89 100644 --- a/spec/functions/deprecation_spec.rb +++ b/spec/functions/deprecation_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -if Puppet.version.to_f >= 4.5 +if Puppet::Util::Package.versioncmp(Puppet.version, '4.5.0') >= 0 describe 'deprecation' do before(:each) { # this is to reset the strict variable to default diff --git a/spec/functions/ensure_resource_spec.rb b/spec/functions/ensure_resource_spec.rb index fddc4c4..5366205 100755 --- a/spec/functions/ensure_resource_spec.rb +++ b/spec/functions/ensure_resource_spec.rb @@ -4,7 +4,7 @@ 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/) } - if Puppet.version.to_f >= 4.6 + if Puppet::Util::Package.versioncmp(Puppet.version, '4.6.0') >= 0 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) } diff --git a/spec/functions/validate_legacy_spec.rb b/spec/functions/validate_legacy_spec.rb index 10b2aee..7b48f12 100644 --- a/spec/functions/validate_legacy_spec.rb +++ b/spec/functions/validate_legacy_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -if Puppet.version.to_f >= 4.4 +if Puppet::Util::Package.versioncmp(Puppet.version, '4.4.0') >= 0 describe 'validate_legacy' do it { is_expected.not_to eq(nil) } it { is_expected.to run.with_params.and_raise_error(ArgumentError) } |