Skip to content

(MODULES-4528) Use versioncmp to check Puppet version for 4.10.x compat #737

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion spec/aliases/absolute_path_spec.rb
Original file line number Diff line number Diff line change
@@ -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{
Expand Down
2 changes: 1 addition & 1 deletion spec/aliases/absolutepath_spec.rb
Original file line number Diff line number Diff line change
@@ -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{
Expand Down
2 changes: 1 addition & 1 deletion spec/aliases/array_spec.rb
Original file line number Diff line number Diff line change
@@ -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
[
Expand Down
2 changes: 1 addition & 1 deletion spec/aliases/bool_spec.rb
Original file line number Diff line number Diff line change
@@ -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
[
Expand Down
2 changes: 1 addition & 1 deletion spec/aliases/float_spec.rb
Original file line number Diff line number Diff line change
@@ -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
[
Expand Down
2 changes: 1 addition & 1 deletion spec/aliases/hash_spec.rb
Original file line number Diff line number Diff line change
@@ -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
[
Expand Down
2 changes: 1 addition & 1 deletion spec/aliases/httpsurl_spec.rb
Original file line number Diff line number Diff line change
@@ -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{
Expand Down
2 changes: 1 addition & 1 deletion spec/aliases/httpurl_spec.rb
Original file line number Diff line number Diff line change
@@ -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{
Expand Down
2 changes: 1 addition & 1 deletion spec/aliases/integer_spec.rb
Original file line number Diff line number Diff line change
@@ -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
[
Expand Down
2 changes: 1 addition & 1 deletion spec/aliases/ip_address.rb
Original file line number Diff line number Diff line change
@@ -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
[
Expand Down
2 changes: 1 addition & 1 deletion spec/aliases/ipv4_spec.rb
Original file line number Diff line number Diff line change
@@ -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|
Expand Down
2 changes: 1 addition & 1 deletion spec/aliases/ipv6_spec.rb
Original file line number Diff line number Diff line change
@@ -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
[
Expand Down
2 changes: 1 addition & 1 deletion spec/aliases/numeric_spec.rb
Original file line number Diff line number Diff line change
@@ -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
[
Expand Down
2 changes: 1 addition & 1 deletion spec/aliases/string_spec.rb
Original file line number Diff line number Diff line change
@@ -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
[
Expand Down
2 changes: 1 addition & 1 deletion spec/aliases/unixpath_spec.rb
Original file line number Diff line number Diff line change
@@ -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{
Expand Down
2 changes: 1 addition & 1 deletion spec/aliases/windowspath_spec.rb
Original file line number Diff line number Diff line change
@@ -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{
Expand Down
2 changes: 1 addition & 1 deletion spec/functions/deprecation_spec.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/functions/ensure_resource_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
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) }
Expand Down
2 changes: 1 addition & 1 deletion spec/functions/validate_legacy_spec.rb
Original file line number Diff line number Diff line change
@@ -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) }
Expand Down