Class: Bogus::StubsConfiguration

Inherits:
Object
  • Object
show all
Includes:
ProxiesMethodCalls
Defined in:
lib/bogus/fake_configuration.rb

Instance Method Summary collapse

Methods included from ProxiesMethodCalls

#proxy

Constructor Details

#initialize(&block) ⇒ StubsConfiguration

Returns a new instance of StubsConfiguration.



57
58
59
# File 'lib/bogus/fake_configuration.rb', line 57

def initialize(&block)
  proxy(:add_stub).instance_eval(&block) if block
end

Instance Method Details

#add_stub(name, value = nil, &block) ⇒ Object



61
62
63
# File 'lib/bogus/fake_configuration.rb', line 61

def add_stub(name, value = nil, &block)
  stubs[name] = block || value
end

#stubsObject



65
66
67
# File 'lib/bogus/fake_configuration.rb', line 65

def stubs
  @stubs ||= {}
end