mirror of
https://github.com/inspec/inspec
synced 2024-11-10 15:14:23 +00:00
Merge pull request #4109 from inspec/zenspider/helper_cleanup
Minor cleanup on test/helper.rb
This commit is contained in:
commit
a2f2cd5087
2 changed files with 5 additions and 4 deletions
|
@ -83,8 +83,7 @@ TMP_CACHE = {}
|
|||
Inspec::Log.logger = Logger.new(nil)
|
||||
|
||||
def load_resource(*args)
|
||||
m = MockLoader.new(:ubuntu1404)
|
||||
m.send('load_resource', *args)
|
||||
MockLoader.new.load_resource(*args)
|
||||
end
|
||||
|
||||
# Used to capture `Inspec.deprecate()` with warn action
|
||||
|
|
|
@ -32,9 +32,9 @@ class MockLoader
|
|||
}
|
||||
|
||||
# pass the os identifier to emulate a specific operating system
|
||||
def initialize(os = nil)
|
||||
def initialize(os = :ubuntu1404)
|
||||
# selects operating system
|
||||
@platform = OPERATING_SYSTEMS[os || :ubuntu1404]
|
||||
@platform = OPERATING_SYSTEMS[os]
|
||||
end
|
||||
|
||||
def backend
|
||||
|
@ -56,6 +56,7 @@ class MockLoader
|
|||
path = ::File.join(scriptpath, '/unit/mock/files', x)
|
||||
local.file(path)
|
||||
}
|
||||
|
||||
mockdir = lambda { |x|
|
||||
md = Object.new
|
||||
|
||||
|
@ -69,6 +70,7 @@ class MockLoader
|
|||
end
|
||||
md
|
||||
}
|
||||
|
||||
emptyfile = lambda {
|
||||
mockfile.call('emptyfile')
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue