Class: Bogus::StubsConfiguration
- Inherits:
-
Object
- Object
- Bogus::StubsConfiguration
- Includes:
- ProxiesMethodCalls
- Defined in:
- lib/bogus/fake_configuration.rb
Instance Method Summary collapse
- #add_stub(name, value = nil, &block) ⇒ Object
-
#initialize(&block) ⇒ StubsConfiguration
constructor
A new instance of StubsConfiguration.
- #stubs ⇒ Object
Methods included from ProxiesMethodCalls
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 |
#stubs ⇒ Object
65 66 67 |
# File 'lib/bogus/fake_configuration.rb', line 65 def stubs @stubs ||= {} end |