Merge pull request #4109 from inspec/zenspider/helper_cleanup

Minor cleanup on test/helper.rb
This commit is contained in:
Ryan Davis 2019-06-03 13:39:31 -07:00 committed by GitHub
commit a2f2cd5087
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View file

@ -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

View file

@ -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')
}