inspec/lib/fetchers/mock.rb
Miah Johnson a4f4fe5231 chefstyle -a; https://github.com/chef/chefstyle/pull/74
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-07-08 17:22:50 -07:00

34 lines
467 B
Ruby

require "inspec/fetcher"
module Fetchers
class Mock < Inspec.fetcher(1)
name "mock"
priority 0
def self.resolve(target)
return nil unless target.is_a? Hash
new(target)
end
def initialize(data)
@data = data
end
def fetch(_path)
archive_path
end
def archive_path
{ mock: @data }
end
def resolved_source
{ mock_fetcher: true }
end
def cache_key
""
end
end
end