Skip to content

Commit ded4d51

Browse files
author
Morgan Haskel
committed
Merge pull request #363 from hunner/fix_windows
Fix exclude windows test on ensure_package
2 parents 202e370 + 3584485 commit ded4d51

File tree

3 files changed

+16
-17
lines changed

3 files changed

+16
-17
lines changed

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/i 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: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,23 @@
44
UNSUPPORTED_PLATFORMS = []
55

66
unless ENV['RS_PROVISION'] == 'no' or ENV['BEAKER_provision'] == 'no'
7-
# This will install the latest available package on el and deb based
8-
# systems fail on windows and osx, and install via gem on other *nixes
9-
foss_opts = { :default_action => 'gem_install' }
7+
foss_opts = {
8+
:default_action => 'gem_install',
9+
:version => (ENV['PUPPET_VERSION'] ? ENV['PUPPET_VERSION'] : '3.7.2'),
10+
}
1011

1112
if default.is_pe?; then install_pe; else install_puppet( foss_opts ); end
1213

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

@@ -29,17 +37,8 @@
2937
default[:default_apply_opts] ||= {}
3038
default[:default_apply_opts].merge!({:parser => 'future'})
3139
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
3640

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

0 commit comments

Comments
 (0)