inspec/lib/fetchers/mock.rb

35 lines
467 B
Ruby
Raw Normal View History

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