mirror of
https://github.com/inspec/inspec
synced 2024-11-30 16:39:20 +00:00
28 lines
401 B
Ruby
28 lines
401 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 files
|
||
|
@data.keys
|
||
|
end
|
||
|
|
||
|
def read(file)
|
||
|
@data[file]
|
||
|
end
|
||
|
end
|
||
|
end
|