diff options
Diffstat (limited to 'spec/spec_helper_acceptance.rb')
-rwxr-xr-x | spec/spec_helper_acceptance.rb | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index 03ff993..f784112 100755 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -36,16 +36,14 @@ 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 - '/etc/puppetlabs/facter/facts.d' + 'C:/ProgramData/PuppetLabs/facter/facts.d' end + 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' end @@ -59,7 +57,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) |