mirror of
https://github.com/inspec/inspec
synced 2024-11-27 07:00:39 +00:00
fae4230a41
This was the next most expensive require in the analysis. Also rearranged the way that ui handled tables to be lazy. ``` % SLOW=1 time rake test:functional before: Finished in 681.514579s, 0.5136 runs/s, 2.9919 assertions/s. after : Finished in 642.655918s, 0.5446 runs/s, 3.1728 assertions/s. ``` Signed-off-by: Ryan Davis <zenspider@chef.io>
33 lines
466 B
Ruby
33 lines
466 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
|