Merge pull request #395 from udienz/master
[puppet-modules/puppetlabs-apt.git] / spec / spec_helper_acceptance.rb
1 require 'beaker-rspec'
2
3 # Install Puppet
4 unless ENV['RS_PROVISION'] == 'no'
5   # This will install the latest available package on el and deb based
6   # systems fail on windows and osx, and install via gem on other *nixes
7   foss_opts = { :default_action => 'gem_install' }
8
9   if default.is_pe?; then install_pe; else install_puppet( foss_opts ); end
10
11   hosts.each do |host|
12     on host, "mkdir -p #{host['distmoduledir']}"
13   end
14 end
15
16 UNSUPPORTED_PLATFORMS = ['RedHat','Suse','windows','AIX','Solaris']
17
18 RSpec.configure do |c|
19   # Project root
20   proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
21
22   # Readable test descriptions
23   c.formatter = :documentation
24
25   # Configure all nodes in nodeset
26   c.before :suite do
27     # Install module and dependencies
28     hosts.each do |host|
29       copy_module_to(host, :source => proj_root, :module_name => 'apt')
30       shell("/bin/touch #{default['puppetpath']}/hiera.yaml")
31       on host, puppet('module install puppetlabs-stdlib --version 2.2.1'), { :acceptable_exit_codes => [0,1] }
32     end
33   end
34 end