spec_helper.rb 803 B

12345678910111213141516171819202122232425262728
  1. require 'rspec-puppet'
  2. require 'puppetlabs_spec_helper/module_spec_helper'
  3. begin
  4. require 'coveralls'
  5. Coveralls.wear!
  6. rescue LoadError
  7. puts "No Coveralls support"
  8. end
  9. fixture_path = File.expand_path(File.join(__FILE__, '..', 'fixtures'))
  10. # include common helpers
  11. support_path = File.expand_path(File.join(File.dirname(__FILE__), '..','spec/support/*.rb'))
  12. Dir[support_path].each {|f| require f}
  13. RSpec.configure do |c|
  14. c.config = '/doesnotexist'
  15. c.module_path = File.expand_path(File.join(File.dirname(__FILE__), 'fixtures/modules'))
  16. c.manifest_dir = File.expand_path(File.join(File.dirname(__FILE__), 'fixtures/manifests'))
  17. end
  18. def param_value(subject, type, title, param)
  19. subject.resource(type, title).send(:parameters)[param.to_sym]
  20. end
  21. at_exit { RSpec::Puppet::Coverage.report! }