mirror of
https://github.com/inspec/inspec
synced 2024-11-22 20:53:11 +00:00
Allow passing opts to mock Config; and use mock config in one more place in test helper
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
This commit is contained in:
parent
b057b0dc01
commit
2186179061
2 changed files with 3 additions and 3 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue