Skip to content

Commit cdb93cd

Browse files
Travis Fieldshunner
authored andcommitted
Fix exclude windows test on ensure_package
Update to fix ensure_resource as well
1 parent 202e370 commit cdb93cd

3 files changed

Lines changed: 12 additions & 14 deletions

File tree

spec/acceptance/ensure_packages_spec.rb

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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_resource function', :unless => (UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) && fact('osfamily') != 'windows') do
4+
describe 'ensure_resource function', :unless => fact('osfamily') =~ /windows/ do
55
describe 'success' do
66
it 'ensure_resource a package' do
77
apply_manifest('package { "rake": ensure => absent, provider => "gem", }')

spec/spec_helper_acceptance.rb

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,15 @@
1111
if default.is_pe?; then install_pe; else install_puppet( foss_opts ); end
1212

1313
hosts.each do |host|
14-
on host, "mkdir -p #{host['distmoduledir']}"
15-
on host, "/bin/touch #{host['puppetpath']}/hiera.yaml"
14+
if host['platform'] !~ /windows/i
15+
if host.is_pe?
16+
on host, 'mkdir -p /etc/puppetlabs/facter/facts.d'
17+
else
18+
on host, "/bin/touch #{host['puppetpath']}/hiera.yaml"
19+
on host, "mkdir -p #{host['distmoduledir']}"
20+
on host, 'mkdir -p /etc/facter/facts.d'
21+
end
22+
end
1623
end
1724
end
1825

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

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

0 commit comments

Comments
 (0)