]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/stdlib/spec/spec_helper_acceptance.rb
upgrade to stdlib 4.6.1
[dsa-puppet.git] / 3rdparty / modules / stdlib / spec / spec_helper_acceptance.rb
1 #! /usr/bin/env ruby -S rspec
2 require 'beaker-rspec'
3
4 UNSUPPORTED_PLATFORMS = []
5
6 unless ENV['RS_PROVISION'] == 'no' or ENV['BEAKER_provision'] == 'no'
7   foss_opts = {
8     :default_action => 'gem_install',
9     :version        => (ENV['PUPPET_VERSION'] ? ENV['PUPPET_VERSION'] : '3.7.2'),
10   }
11
12   if default.is_pe?; then install_pe; else install_puppet( foss_opts ); end
13
14   hosts.each do |host|
15     if host['platform'] !~ /windows/i
16       if host.is_pe?
17         on host, 'mkdir -p /etc/puppetlabs/facter/facts.d'
18       else
19         on host, "/bin/touch #{host['puppetpath']}/hiera.yaml"
20         on host, "mkdir -p #{host['distmoduledir']}"
21         on host, 'mkdir -p /etc/facter/facts.d'
22       end
23     end
24   end
25 end
26
27 RSpec.configure do |c|
28   # Project root
29   proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
30
31   # Readable test descriptions
32   c.formatter = :documentation
33
34   # Configure all nodes in nodeset
35   c.before :suite do
36     if ENV['FUTURE_PARSER'] == 'true'
37       default[:default_apply_opts] ||= {}
38       default[:default_apply_opts].merge!({:parser => 'future'})
39     end
40
41     copy_root_module_to(default, :source => proj_root, :module_name => 'stdlib')
42   end
43 end
44
45 def is_future_parser_enabled?
46   if default[:default_apply_opts]
47     return default[:default_apply_opts][:parser] == 'future'
48   end
49   return false
50 end