Skip to content

Commit

Permalink
Merge pull request #909 from ekohl/clean-up-mock_with
Browse files Browse the repository at this point in the history
Move mock_with to a single RSpec.configure block
  • Loading branch information
bastelfreak committed Jun 15, 2024
2 parents 41c2dfb + e752b39 commit 399dea6
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions moduleroot/spec/spec_helper.rb.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,21 @@

# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
<%- if @configs['mock_with'] -%>

RSpec.configure do |c|
c.mock_with <%= @configs['mock_with'] %>
end
<%- end -%>

# puppetlabs_spec_helper will set up coverage if the env variable is set.
# We want to do this if lib exists and it hasn't been explicitly set.
ENV['COVERAGE'] ||= 'yes' if Dir.exist?(File.expand_path('../lib', __dir__))

require 'voxpupuli/test/spec_helper'
<%- if @configs['hiera_config'] -%>
<%- if @configs['hiera_config'] || @configs['mock_with'] -%>

RSpec.configure do |c|
<%- if @configs['hiera_config'] -%>
c.hiera_config = <%= @configs['hiera_config'] %>
<%- end -%>
<%- if @configs['mock_with'] -%>
c.mock_with <%= @configs['mock_with'] %>
<%- end -%>
end
<%- end -%>
<%- if @configs['add_mocked_facts'] -%>
Expand Down

0 comments on commit 399dea6

Please sign in to comment.