From 78e8c73671d0d3b69b2999094ec3af638327f7c0 Mon Sep 17 00:00:00 2001 From: Travis Fields Date: Mon, 20 Jul 2015 14:35:57 -0700 Subject: (maint) Fix test to not assume is_pe fact on > 4.0.0 puppet --- spec/acceptance/fqdn_rand_string_spec.rb | 3 ++- spec/acceptance/fqdn_rotate_spec.rb | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'spec/acceptance') diff --git a/spec/acceptance/fqdn_rand_string_spec.rb b/spec/acceptance/fqdn_rand_string_spec.rb index 881cff3..fec3c93 100644 --- a/spec/acceptance/fqdn_rand_string_spec.rb +++ b/spec/acceptance/fqdn_rand_string_spec.rb @@ -4,7 +4,8 @@ require 'spec_helper_acceptance' describe 'fqdn_rand_string function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do describe 'success' do let(:facts_d) do - if fact('is_pe', '--puppet') == "true" + puppet_version = (on default, puppet('--version')).output.chomp + if puppet_version < '4.0.0' && fact('is_pe', '--puppet') == "true" if fact('osfamily') =~ /windows/i if fact('kernelmajversion').to_f < 6.0 'c:/documents and settings/all users/application data/puppetlabs/facter/facts.d' diff --git a/spec/acceptance/fqdn_rotate_spec.rb b/spec/acceptance/fqdn_rotate_spec.rb index f1a15d3..556c609 100755 --- a/spec/acceptance/fqdn_rotate_spec.rb +++ b/spec/acceptance/fqdn_rotate_spec.rb @@ -4,7 +4,8 @@ require 'spec_helper_acceptance' describe 'fqdn_rotate function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do describe 'success' do let(:facts_d) do - if fact('is_pe', '--puppet') == "true" + puppet_version = (on default, puppet('--version')).output.chomp + if puppet_version < '4.0.0' && fact('is_pe', '--puppet') == "true" if fact('osfamily') =~ /windows/i if fact('kernelmajversion').to_f < 6.0 'C:/Documents and Settings/All Users/Application Data/PuppetLabs/facter/facts.d' -- cgit v1.2.3