Slackbot
05/09/2023, 12:36 PMYury Bushmelev
05/09/2023, 12:43 PM# "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
Yury Bushmelev
05/09/2023, 12:44 PMYury Bushmelev
05/09/2023, 12:44 PMinclude_context 'clean_room'
in every spec before.. then decided to move it to a helperYury Bushmelev
05/09/2023, 12:45 PM:type
doesn’t work for me btw.. have no idea whyNick Bertrand
05/09/2023, 2:29 PMdefault_trusted_facts
? https://github.com/puppetlabs/rspec-puppet/tree/f4c5c71dd0271f42891d76a0d017331da7f0c126#default_trusted_facts