Class: Fauxhai::Mocker
- Inherits:
-
Object
- Object
- Fauxhai::Mocker
- Defined in:
- lib/fauxhai/mocker.rb
Constant Summary collapse
- RAW_BASE =
The base URL for the GitHub project (raw)
'https://raw.github.com/customink/fauxhai/master'
Instance Attribute Summary collapse
-
#data ⇒ Hash
readonly
The raw ohai data for the given Mock.
Instance Method Summary collapse
-
#initialize(options = {}) {|@data| ... } ⇒ Mocker
constructor
Create a new Ohai Mock with fauxhai.
Constructor Details
#initialize(options = {}) {|@data| ... } ⇒ Mocker
Create a new Ohai Mock with fauxhai.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/fauxhai/mocker.rb', line 23 def initialize( = {}, &override_attributes) @options = @data = fauxhai_data yield(@data) if block_given? if defined?(::ChefSpec) && ::ChefSpec::VERSION <= '0.9.0' data = @data ::ChefSpec::ChefRunner.send :define_method, :fake_ohai do |ohai| data.each_pair do |attribute, value| ohai[attribute] = value end end end @data end |
Instance Attribute Details
#data ⇒ Hash (readonly)
Returns The raw ohai data for the given Mock.
11 12 13 |
# File 'lib/fauxhai/mocker.rb', line 11 def data @data end |