spec_helper_acceptance.rb 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. require 'beaker-rspec/spec_helper'
  2. require 'beaker-rspec/helpers/serverspec'
  3. unless ENV['RS_PROVISION'] == 'no'
  4. # This will install the latest available package on el and deb based
  5. # systems fail on windows and osx, and install via gem on other *nixes
  6. foss_opts = { :default_action => 'gem_install' }
  7. if default.is_pe?; then install_pe; else install_puppet( foss_opts ); end
  8. hosts.each do |host|
  9. if host['platform'] =~ /debian/
  10. on host, 'echo \'export PATH=/var/lib/gems/1.8/bin/:${PATH}\' >> ~/.bashrc'
  11. on host, "mkdir -p #{host['distmoduledir']}"
  12. end
  13. end
  14. end
  15. RSpec.configure do |c|
  16. # Project root
  17. proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
  18. # Readable test descriptions
  19. c.formatter = :documentation
  20. # Configure all nodes in nodeset
  21. c.before :suite do
  22. # Install module and dependencies
  23. hosts.each do |host|
  24. if host['platform'] !~ /windows/i
  25. copy_root_module_to(host, :source => proj_root, :module_name => 'inifile')
  26. end
  27. end
  28. hosts.each do |host|
  29. if host['platform'] =~ /windows/i
  30. on host, puppet('plugin download')
  31. end
  32. end
  33. end
  34. c.treat_symbols_as_metadata_keys_with_true_values = true
  35. end