Skip to content

Commit b50f1db

Browse files
author
Travis Fields
committed
Fix exclude windows test on ensure_package
Update to fix ensure_resource as well
1 parent 03f0ecd commit b50f1db

File tree

3 files changed

+11
-19
lines changed

3 files changed

+11
-19
lines changed

spec/acceptance/ensure_packages_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#! /usr/bin/env ruby -S rspec
22
require 'spec_helper_acceptance'
33

4-
describe 'ensure_packages function', :unless => (UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) || fact('osfamily') == 'windows') do
4+
describe 'ensure_packages function', :unless => fact('osfamily') =~ /windows/i do
55
describe 'success' do
66
it 'ensure_packages a package' do
77
apply_manifest('package { "rake": ensure => absent, provider => "gem", }')

spec/acceptance/ensure_resource_spec.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#! /usr/bin/env ruby -S rspec
22
require 'spec_helper_acceptance'
33

4-
5-
describe 'ensure_resource function', :unless => (UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) || fact('osfamily') == 'windows') do
4+
describe 'ensure_resource function', :unless => fact('osfamily') =~ /windows/ do
65
describe 'success' do
76
it 'ensure_resource a package' do
87
apply_manifest('package { "rake": ensure => absent, provider => "gem", }')

spec/spec_helper_acceptance.rb

+9-16
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@
88
install_pe
99
on hosts, 'mkdir -p /etc/puppetlabs/facter/facts.d'
1010
else
11-
install_puppet
12-
on hosts, 'mkdir -p /etc/facter/facts.d'
13-
on hosts, '/bin/touch /etc/puppet/hiera.yaml'
14-
end
15-
hosts.each do |host|
16-
on host, "mkdir -p #{host['distmoduledir']}"
11+
install_puppet :version => (ENV['PUPPET_VERSION'] ? ENV['PUPPET_VERSION'] : '3.7.2')
12+
hosts.each do |host|
13+
if host['platform'] !~ /windows/i
14+
on host, 'mkdir -p /etc/facter/facts.d'
15+
on host, '/bin/touch /etc/puppet/hiera.yaml'
16+
on host, "mkdir -p #{host['distmoduledir']}"
17+
end
18+
end
1719
end
1820
end
1921

@@ -30,17 +32,8 @@
3032
default[:default_apply_opts] ||= {}
3133
default[:default_apply_opts].merge!({:parser => 'future'})
3234
end
33-
hosts.each do |host|
34-
if host['platform'] !~ /windows/i
35-
copy_root_module_to(host, :source => proj_root, :module_name => 'stdlib')
36-
end
3735

38-
end
39-
hosts.each do |host|
40-
if host['platform'] =~ /windows/i
41-
on host, puppet('plugin download')
42-
end
43-
end
36+
copy_root_module_to(default, :source => proj_root, :module_name => 'stdlib')
4437
end
4538
end
4639

0 commit comments

Comments
 (0)