summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorWilson McCoubrey <wilson@mccoubreys.co.uk>2017-03-16 13:42:03 +0000
committerGitHub <noreply@github.com>2017-03-16 13:42:03 +0000
commit60e9e0beb8f42937a03143b98dc9bcf51a5b6e2d (patch)
treedfbf6cb6ff835f684ee6a5c14da183badee29145 /spec
parent2a7c2beddb76fbfc98121acc34b53f925d5232ad (diff)
parent318dcfaec6ba6d0e4af1e32e55ea20b721679537 (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')
-rw-r--r--spec/aliases/absolute_path_spec.rb2
-rw-r--r--spec/aliases/absolutepath_spec.rb2
-rw-r--r--spec/aliases/array_spec.rb2
-rw-r--r--spec/aliases/bool_spec.rb2
-rw-r--r--spec/aliases/float_spec.rb2
-rw-r--r--spec/aliases/hash_spec.rb2
-rw-r--r--spec/aliases/httpsurl_spec.rb2
-rw-r--r--spec/aliases/httpurl_spec.rb2
-rw-r--r--spec/aliases/integer_spec.rb2
-rw-r--r--spec/aliases/ip_address.rb2
-rw-r--r--spec/aliases/ipv4_spec.rb2
-rw-r--r--spec/aliases/ipv6_spec.rb2
-rw-r--r--spec/aliases/numeric_spec.rb2
-rw-r--r--spec/aliases/string_spec.rb2
-rw-r--r--spec/aliases/unixpath_spec.rb2
-rw-r--r--spec/aliases/windowspath_spec.rb2
-rw-r--r--spec/functions/deprecation_spec.rb2
-rwxr-xr-xspec/functions/ensure_resource_spec.rb2
-rw-r--r--spec/functions/validate_legacy_spec.rb2
19 files changed, 19 insertions, 19 deletions
diff --git a/spec/aliases/absolute_path_spec.rb b/spec/aliases/absolute_path_spec.rb
index 682c283..308a3aa 100644
--- a/spec/aliases/absolute_path_spec.rb
+++ b/spec/aliases/absolute_path_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 'test::absolute_path', type: :class do
describe 'valid paths handling' do
%w{
diff --git a/spec/aliases/absolutepath_spec.rb b/spec/aliases/absolutepath_spec.rb
index a20c071..cd442f2 100644
--- a/spec/aliases/absolutepath_spec.rb
+++ b/spec/aliases/absolutepath_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 'test::absolutepath', type: :class do
describe 'valid handling' do
%w{
diff --git a/spec/aliases/array_spec.rb b/spec/aliases/array_spec.rb
index d0f9877..89cc2af 100644
--- a/spec/aliases/array_spec.rb
+++ b/spec/aliases/array_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 'test::array', type: :class do
describe 'accepts arrays' do
[
diff --git a/spec/aliases/bool_spec.rb b/spec/aliases/bool_spec.rb
index 78c57fc..b84ab51 100644
--- a/spec/aliases/bool_spec.rb
+++ b/spec/aliases/bool_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 'test::bool', type: :class do
describe 'accepts booleans' do
[
diff --git a/spec/aliases/float_spec.rb b/spec/aliases/float_spec.rb
index cc20758..66079c6 100644
--- a/spec/aliases/float_spec.rb
+++ b/spec/aliases/float_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 'test::float', type: :class do
describe 'accepts floats' do
[
diff --git a/spec/aliases/hash_spec.rb b/spec/aliases/hash_spec.rb
index e10a04b..6e5060d 100644
--- a/spec/aliases/hash_spec.rb
+++ b/spec/aliases/hash_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 'test::hash', type: :class do
describe 'accepts hashes' do
[
diff --git a/spec/aliases/httpsurl_spec.rb b/spec/aliases/httpsurl_spec.rb
index 9cc9a76..3e51118 100644
--- a/spec/aliases/httpsurl_spec.rb
+++ b/spec/aliases/httpsurl_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 'test::httpsurl', type: :class do
describe 'valid handling' do
%w{
diff --git a/spec/aliases/httpurl_spec.rb b/spec/aliases/httpurl_spec.rb
index f92ddb3..fd49a47 100644
--- a/spec/aliases/httpurl_spec.rb
+++ b/spec/aliases/httpurl_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 'test::httpurl', type: :class do
describe 'valid handling' do
%w{
diff --git a/spec/aliases/integer_spec.rb b/spec/aliases/integer_spec.rb
index 260090a..bd00c2a 100644
--- a/spec/aliases/integer_spec.rb
+++ b/spec/aliases/integer_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 'test::integer', type: :class do
describe 'accepts integers' do
[
diff --git a/spec/aliases/ip_address.rb b/spec/aliases/ip_address.rb
index 664bf24..67a555c 100644
--- a/spec/aliases/ip_address.rb
+++ b/spec/aliases/ip_address.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 'test::ip_address', type: :class do
describe 'accepts ipv4 and ipv6 addresses' do
[
diff --git a/spec/aliases/ipv4_spec.rb b/spec/aliases/ipv4_spec.rb
index 210b4b1..6a503ad 100644
--- a/spec/aliases/ipv4_spec.rb
+++ b/spec/aliases/ipv4_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 'test::ipv4', type: :class do
describe 'accepts ipv4 addresses' do
SharedData::IPV4_PATTERNS.each do |value|
diff --git a/spec/aliases/ipv6_spec.rb b/spec/aliases/ipv6_spec.rb
index 6237eba..ae90f42 100644
--- a/spec/aliases/ipv6_spec.rb
+++ b/spec/aliases/ipv6_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 'test::ipv6', type: :class do
describe 'accepts ipv6 addresses' do
[
diff --git a/spec/aliases/numeric_spec.rb b/spec/aliases/numeric_spec.rb
index 0e98bee..bc17f4f 100644
--- a/spec/aliases/numeric_spec.rb
+++ b/spec/aliases/numeric_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 'test::numeric', type: :class do
describe 'accepts numerics' do
[
diff --git a/spec/aliases/string_spec.rb b/spec/aliases/string_spec.rb
index 8a93585..d8fb885 100644
--- a/spec/aliases/string_spec.rb
+++ b/spec/aliases/string_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 'test::string', type: :class do
describe 'accepts strings' do
[
diff --git a/spec/aliases/unixpath_spec.rb b/spec/aliases/unixpath_spec.rb
index 505516a..6aecfe7 100644
--- a/spec/aliases/unixpath_spec.rb
+++ b/spec/aliases/unixpath_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 'test::unixpath', type: :class do
describe 'valid handling' do
%w{
diff --git a/spec/aliases/windowspath_spec.rb b/spec/aliases/windowspath_spec.rb
index b8ddcb7..c20e373 100644
--- a/spec/aliases/windowspath_spec.rb
+++ b/spec/aliases/windowspath_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 'test::windowspath', type: :class do
describe 'valid handling' do
%w{
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) }