Sha256: c4856498f7b818665708f4c8a9dbe0d6342275b4cd9b5951867673a5ba33767a

Contents?: true

Size: 1.71 KB

Versions: 13

Compression:

Stored size: 1.71 KB

Contents

# Yes it's strange that we have to call `RSpec.configure` more than once. The
# reason we are doing this is to silence the incredibly annoying warning:
#
# puppetlabs_spec_helper: defaults `mock_with` to `:mocha`
#
# In order to do this we have configure the
# mocking, THEN require puppetlabs_spec_helper.
#
# Yes, I know. Someone buy me a 🍺 for fixing this.
#
RSpec.configure do |c|
  c.mock_with :mocha
end

require 'puppetlabs_spec_helper/module_spec_helper'
require 'rspec_junit_formatter'
require 'onceover/rspec/formatters'

RSpec.configure do |c|
  # Create onceover settings to be accessed by formatters
  c.add_setting :onceover_tempdir
  c.add_setting :onceover_root
  c.add_setting :onceover_environmentpath

  c.onceover_tempdir         = <%= repo.tempdir.inspect %>
  c.onceover_root            = <%= repo.root.inspect %>
  c.onceover_environmentpath = <%= repo.environmentpath.inspect %>

  # Also add JUnit output in case people want to use that
  c.add_formatter('RSpecJUnitFormatter','<%= repo.tempdir %>/spec.xml')

  c.parser                = 'future'
<% @formatters.each do |fm| -%>
  c.formatter             = '<%= fm %>'
<% end -%>
  c.trusted_server_facts  = true
  c.environmentpath       = '<%= environmentpath %>'
  c.module_path           = '<%= modulepath %>'
<% if repo.hiera_config_file_relative_path %>
  c.hiera_config          = '<%= environmentpath %>/production/<%= repo.hiera_config_file_relative_path %>'
<% end -%>
  c.manifest              = '<%= repo.temp_manifest %>'
  ENV['STRICT_VARIABLES'] = '<%= self.strict_variables %>'
<% if ENV['SHOW_PUPPET_OUTPUT'] and ENV['SHOW_PUPPET_OUTPUT'].downcase == 'true' %>
  Puppet::Util::Log.level = :debug
  Puppet::Util::Log.newdestination(:console)
<% end -%>
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
onceover-3.14.1 templates/spec_helper.rb.erb
onceover-3.14.0 templates/spec_helper.rb.erb
onceover-3.13.4 templates/spec_helper.rb.erb
onceover-3.13.3 templates/spec_helper.rb.erb
onceover-3.13.2 templates/spec_helper.rb.erb
onceover-3.13.1 templates/spec_helper.rb.erb
onceover-3.13.0 templates/spec_helper.rb.erb
onceover-3.12.5 templates/spec_helper.rb.erb
onceover-3.12.4 templates/spec_helper.rb.erb
onceover-3.12.3 templates/spec_helper.rb.erb
onceover-3.12.2 templates/spec_helper.rb.erb
onceover-3.12.1 templates/spec_helper.rb.erb
onceover-3.12.0 templates/spec_helper.rb.erb