From dfa98b89f7a5513cccc5a4ded4b119dee39d1a59 Mon Sep 17 00:00:00 2001 From: Hunter Haugen Date: Mon, 10 Aug 2015 16:15:54 -0700 Subject: Prep 4.8.0 --- spec/acceptance/ensure_resource_spec.rb | 2 +- spec/spec_helper_acceptance.rb | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) (limited to 'spec') diff --git a/spec/acceptance/ensure_resource_spec.rb b/spec/acceptance/ensure_resource_spec.rb index 1cee53d..fe619a9 100755 --- a/spec/acceptance/ensure_resource_spec.rb +++ b/spec/acceptance/ensure_resource_spec.rb @@ -1,7 +1,7 @@ #! /usr/bin/env ruby -S rspec require 'spec_helper_acceptance' -describe 'ensure_resource function', :unless => fact('osfamily') =~ /windows/i do +describe 'ensure_resource function', :unless => fact('osfamily') =~ /(windows|Suse)/i do describe 'success' do it 'ensure_resource a package' do apply_manifest('package { "rake": ensure => absent, provider => "gem", }') diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index 03ff993..406fcb6 100755 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -35,15 +35,13 @@ end RSpec.shared_context "with faked facts" do let(:facts_d) do - puppet_version = (on default, puppet('--version')).output.chomp - if Puppet::Util::Package.versioncmp(puppet_version, '4.0.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' - else - 'C:/ProgramData/PuppetLabs/facter/facts.d' - end + if fact('osfamily') =~ /windows/i + if fact('kernelmajversion').to_f < 6.0 + 'C:/Documents and Settings/All Users/Application Data/PuppetLabs/facter/facts.d' else + 'C:/ProgramData/PuppetLabs/facter/facts.d' + end + elsif fact('is_pe', '--puppet') == "true" '/etc/puppetlabs/facter/facts.d' end else -- cgit v1.2.3 From 0a58b9382c9cb5eb74519219dfe0cce1dd814993 Mon Sep 17 00:00:00 2001 From: Hunter Haugen Date: Tue, 11 Aug 2015 08:29:48 -0700 Subject: Fix extraneous end --- spec/spec_helper_acceptance.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'spec') diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index 406fcb6..5556cbf 100755 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -42,8 +42,7 @@ RSpec.shared_context "with faked facts" do 'C:/ProgramData/PuppetLabs/facter/facts.d' end elsif fact('is_pe', '--puppet') == "true" - '/etc/puppetlabs/facter/facts.d' - end + '/etc/puppetlabs/facter/facts.d' else '/etc/facter/facts.d' end -- cgit v1.2.3 From 9baca7f7556e1db3722e992244f98e54aef41309 Mon Sep 17 00:00:00 2001 From: Hunter Haugen Date: Tue, 11 Aug 2015 16:23:06 -0700 Subject: Sometimes this exits 1 --- spec/spec_helper_acceptance.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spec') diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index 5556cbf..67a6e33 100755 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -56,7 +56,7 @@ RSpec.shared_context "with faked facts" do end after :each do - shell("rm -f '#{facts_d}/fqdn.txt'") + shell("rm -f '#{facts_d}/fqdn.txt'", :acceptable_exit_codes => [0,1]) end def fake_fact(name, value) -- cgit v1.2.3 From 57275061ab63f26c0fc08361cb0d838708b1003c Mon Sep 17 00:00:00 2001 From: Hunter Haugen Date: Tue, 11 Aug 2015 19:52:43 -0700 Subject: Add puppet_version back to spec_helper --- spec/spec_helper_acceptance.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'spec') diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index 67a6e33..f784112 100755 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -35,13 +35,14 @@ end RSpec.shared_context "with faked facts" do let(:facts_d) do + puppet_version = (on default, puppet('--version')).output.chomp if fact('osfamily') =~ /windows/i if fact('kernelmajversion').to_f < 6.0 'C:/Documents and Settings/All Users/Application Data/PuppetLabs/facter/facts.d' else 'C:/ProgramData/PuppetLabs/facter/facts.d' end - elsif fact('is_pe', '--puppet') == "true" + elsif Puppet::Util::Package.versioncmp(puppet_version, '4.0.0') < 0 and fact('is_pe', '--puppet') == "true" '/etc/puppetlabs/facter/facts.d' else '/etc/facter/facts.d' -- cgit v1.2.3