diff --git a/lib/inspec/config.rb b/lib/inspec/config.rb index b0eef9cfc..64a67338a 100644 --- a/lib/inspec/config.rb +++ b/lib/inspec/config.rb @@ -25,8 +25,8 @@ module Inspec attr_reader :final_options # This makes it easy to make a config with a mock backend. - def self.mock - Inspec::Config.new({ backend: :mock }, StringIO.new('{}')) + def self.mock(opts = {}) + Inspec::Config.new({ backend: :mock }.merge(opts), StringIO.new('{}')) end def initialize(cli_opts = {}, cfg_io = nil, command_name = nil) diff --git a/test/helper.rb b/test/helper.rb index e44a2860c..3190f386b 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -609,7 +609,7 @@ class MockLoader def self.load_profile(name, opts = {}) opts[:test_collector] = Inspec::RunnerMock.new - opts[:backend] = Inspec::Backend.create(opts) + opts[:backend] = Inspec::Backend.create(Inspec::Config.mock(opts)) Inspec::Profile.for_target(profile_path(name), opts) end