Class: Bogus::FakeConfiguration
- Inherits:
-
Object
- Object
- Bogus::FakeConfiguration
- Defined in:
- lib/bogus/fake_configuration.rb
Instance Method Summary collapse
- #evaluate(&block) ⇒ Object
- #fake(name, opts = {}, &block) ⇒ Object
- #get(name) ⇒ Object
- #include?(name) ⇒ Boolean
Instance Method Details
#evaluate(&block) ⇒ Object
16 17 18 |
# File 'lib/bogus/fake_configuration.rb', line 16 def evaluate(&block) instance_eval(&block) end |
#fake(name, opts = {}, &block) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/bogus/fake_configuration.rb', line 7 def fake(name, opts = {}, &block) opts = opts.dup class_block = opts.delete(:class) fakes[name] = FakeDefinition.new(name: name, opts: opts, stubs: stubs_hash(&block), class_block: class_block) end |
#get(name) ⇒ Object
20 21 22 |
# File 'lib/bogus/fake_configuration.rb', line 20 def get(name) fakes[name] end |
#include?(name) ⇒ Boolean
3 4 5 |
# File 'lib/bogus/fake_configuration.rb', line 3 def include?(name) fakes.key?(name) end |