This message was deleted.
# puppet
s
This message was deleted.
y
Copy code
# "clean room" shared context
RSpec.shared_context 'clean_room' do
  let(:node) { 'this.is.only.used.for.unit.tests' }
  let(:hiera_config) { '/dev/null' }
end

  # Run non-host/non-plan tests in a clean room (fake node, no hiera)
RSpec.configure do |c|
  c.include_context 'clean_room', file_path: proc { |x| !['hosts', 'plans'].include? File.dirname(x).split('/')[-1] }
end
I have this in my spec_helper_local.rb in one very special repo 😉
I was adding the
include_context 'clean_room'
in every spec before.. then decided to move it to a helper
:type
doesn’t work for me btw.. have no idea why
n