Skip to content

Commit 12ecdd4

Browse files
author
Travis Fields
committed
Fix exclude windows test on ensure_package
Update to fix ensure_resource as well Conflicts: spec/acceptance/ensure_packages_spec.rb spec/acceptance/ensure_resource_spec.rb spec/spec_helper_acceptance.rb
1 parent 202e370 commit 12ecdd4

File tree

3 files changed

+23
-21
lines changed

3 files changed

+23
-21
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/ 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: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,26 @@
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' }
10-
11-
if default.is_pe?; then install_pe; else install_puppet( foss_opts ); end
12-
13-
hosts.each do |host|
14-
on host, "mkdir -p #{host['distmoduledir']}"
15-
on host, "/bin/touch #{host['puppetpath']}/hiera.yaml"
7+
if hosts.first.is_pe?
8+
install_pe
9+
hosts.each do |host|
10+
if host['platform'] !~ /windows/i
11+
on host, 'mkdir -p /etc/puppetlabs/facter/facts.d'
12+
end
13+
end
14+
else
15+
foss_opts = {:default_action => 'gem_install'}
16+
if ENV['PUPPET_VERSION']
17+
foss_opts[:version] = ENV['PUPPET_VERSION']
18+
end
19+
install_puppet foss_opts
20+
hosts.each do |host|
21+
if host['platform'] !~ /windows/i
22+
on host, 'mkdir -p /etc/facter/facts.d'
23+
on host, '/bin/touch /etc/puppet/hiera.yaml'
24+
on host, "mkdir -p #{host['distmoduledir']}"
25+
end
26+
end
1627
end
1728
end
1829

@@ -29,17 +40,8 @@
2940
default[:default_apply_opts] ||= {}
3041
default[:default_apply_opts].merge!({:parser => 'future'})
3142
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
3643

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

0 commit comments

Comments
 (0)