Skip to content

Commit b6ce61d

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

File tree

3 files changed

+10
-15
lines changed

3 files changed

+10
-15
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

+8-12
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@
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'
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+
end
17+
end
1418
end
1519
hosts.each do |host|
1620
on host, "mkdir -p #{host['distmoduledir']}"
@@ -31,15 +35,7 @@
3135
default[:default_apply_opts].merge!({:parser => 'future'})
3236
end
3337
hosts.each do |host|
34-
if host['platform'] !~ /windows/i
35-
copy_root_module_to(host, :source => proj_root, :module_name => 'stdlib')
36-
end
37-
38-
end
39-
hosts.each do |host|
40-
if host['platform'] =~ /windows/i
41-
on host, puppet('plugin download')
42-
end
38+
copy_root_module_to(host, :source => proj_root, :module_name => 'stdlib')
4339
end
4440
end
4541
end

0 commit comments

Comments
 (0)