apt: Allow managing of preferences file.
[puppet-modules/puppetlabs-apt.git] / spec / spec_helper_acceptance.rb
1 require 'beaker-rspec'
2
3 unless ENV['RS_PROVISION'] == 'no'
4   hosts.each do |host|
5     # Install Puppet
6     if host.is_pe?
7       install_pe
8     else
9       install_package host, 'rubygems'
10       on host, 'gem install puppet --no-ri --no-rdoc'
11       on host, "mkdir -p #{host['distmoduledir']}"
12     end
13   end
14 end
15
16 RSpec.configure do |c|
17   # Project root
18   proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
19
20   # Readable test descriptions
21   c.formatter = :documentation
22
23   # Configure all nodes in nodeset
24   c.before :suite do
25     # Install module and dependencies
26     puppet_module_install(:source => proj_root, :module_name => 'apt')
27     hosts.each do |host|
28       shell('/bin/touch /etc/puppet/hiera.yaml')
29       shell('puppet module install puppetlabs-stdlib --version 2.2.1', { :acceptable_exit_codes => [0,1] })
30     end
31   end
32 end