summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rwxr-xr-xspec/acceptance/ensure_resource_spec.rb2
-rwxr-xr-xspec/spec_helper_acceptance.rb16
2 files changed, 8 insertions, 10 deletions
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..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)