mirror of
https://github.com/inspec/inspec
synced 2024-11-30 08:30:39 +00:00
6814d6ad2b
If a URL based source does not match the shasum recorded in the lockfile, it likely means a new version has been pushed to the remote source. In this case, we fail to help ensure that when using a lockfile we always run the same code as when the lockfile was created. Signed-off-by: Steven Danna <steve@chef.io>
35 lines
514 B
Ruby
35 lines
514 B
Ruby
# encoding: utf-8
|
|
# author: Dominik Richter
|
|
# author: Christoph Hartmann
|
|
|
|
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
|