Merge pull request #347 from mhaskel/hiera_fix
[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   hosts.each do |host|
6     if host.is_pe?
7       install_pe
8     else
9       install_puppet
10       on host, "mkdir -p #{host['distmoduledir']}"
11     end
12   end
13 end
14
15 UNSUPPORTED_PLATFORMS = ['RedHat','Suse','windows','AIX','Solaris']
16
17 RSpec.configure do |c|
18   # Project root
19   proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
20
21   # Readable test descriptions
22   c.formatter = :documentation
23
24   # Configure all nodes in nodeset
25   c.before :suite do
26     # Install module and dependencies
27     puppet_module_install(:source => proj_root, :module_name => 'apt')
28     hosts.each do |host|
29       shell("/bin/touch #{default['puppetpath']}/hiera.yaml")
30       shell('puppet module install puppetlabs-stdlib --version 2.2.1', { :acceptable_exit_codes => [0,1] })
31     end
32   end
33 end