Module: Bogus::PublicMethods
- Included in:
- Bogus
- Defined in:
- lib/bogus/public_methods.rb
Instance Method Summary collapse
- #add_contract_verification(syntax, name, &block) ⇒ Object
- #after_each_test ⇒ Object
- #clear ⇒ Object
- #clear_expectations ⇒ Object
- #config ⇒ Object
- #configure(&block) ⇒ Object
- #create_mock(*args) ⇒ Object
- #create_stub(*args) ⇒ Object
- #ensure_all_expectations_satisfied! ⇒ Object
- #fake_class(*args) ⇒ Object
- #fake_for(*args, &block) ⇒ Object
- #fakes(&block) ⇒ Object
- #have_received(*args) ⇒ Object
- #inject ⇒ Object
- #make_duck(*args) ⇒ Object
- #record_calls_for(name, klass = nil) ⇒ Object
- #reset! ⇒ Object
- #reset_overwritten_classes ⇒ Object
- #reset_stubbed_methods ⇒ Object
- #verify_contract!(fake_name) ⇒ Object
Instance Method Details
#add_contract_verification(syntax, name, &block) ⇒ Object
7 8 9 |
# File 'lib/bogus/public_methods.rb', line 7 def add_contract_verification(syntax, name, &block) inject.adds_contract_verification(syntax).add(name, &block) end |
#after_each_test ⇒ Object
52 53 54 55 56 |
# File 'lib/bogus/public_methods.rb', line 52 def after_each_test ensure_all_expectations_satisfied! ensure clear end |
#clear ⇒ Object
58 59 60 61 62 |
# File 'lib/bogus/public_methods.rb', line 58 def clear reset_stubbed_methods clear_expectations reset_overwritten_classes end |
#clear_expectations ⇒ Object
69 70 71 |
# File 'lib/bogus/public_methods.rb', line 69 def clear_expectations inject.clear_tracked_doubles end |
#config ⇒ Object
19 20 21 |
# File 'lib/bogus/public_methods.rb', line 19 def config inject.configuration end |
#configure(&block) ⇒ Object
15 16 17 |
# File 'lib/bogus/public_methods.rb', line 15 def configure(&block) config.tap(&block) end |
#create_mock(*args) ⇒ Object
32 33 34 |
# File 'lib/bogus/public_methods.rb', line 32 def create_mock(*args) inject.create_mock(*args) end |
#create_stub(*args) ⇒ Object
28 29 30 |
# File 'lib/bogus/public_methods.rb', line 28 def create_stub(*args) inject.create_stub(*args) end |
#ensure_all_expectations_satisfied! ⇒ Object
64 65 66 67 |
# File 'lib/bogus/public_methods.rb', line 64 def ensure_all_expectations_satisfied! doubles = inject.double_tracker.doubles inject.ensures_all_interactions_satisfied.ensure_satisfied!(doubles) end |
#fake_class(*args) ⇒ Object
48 49 50 |
# File 'lib/bogus/public_methods.rb', line 48 def fake_class(*args) inject.fakes_classes.fake(*args) end |
#fake_for(*args, &block) ⇒ Object
44 45 46 |
# File 'lib/bogus/public_methods.rb', line 44 def fake_for(*args, &block) inject.creates_fakes_with_stubbed_methods.create(*args, &block) end |
#fakes(&block) ⇒ Object
81 82 83 |
# File 'lib/bogus/public_methods.rb', line 81 def fakes(&block) inject.fake_configuration.evaluate(&block) end |
#have_received(*args) ⇒ Object
40 41 42 |
# File 'lib/bogus/public_methods.rb', line 40 def have_received(*args) inject.have_received_matcher.build(*args) end |
#inject ⇒ Object
85 86 87 |
# File 'lib/bogus/public_methods.rb', line 85 def inject @injector ||= Bogus::Injector.new end |
#make_duck(*args) ⇒ Object
36 37 38 |
# File 'lib/bogus/public_methods.rb', line 36 def make_duck(*args) inject.makes_ducks.make(*args) end |
#record_calls_for(name, klass = nil) ⇒ Object
3 4 5 |
# File 'lib/bogus/public_methods.rb', line 3 def record_calls_for(name, klass = nil) inject.adds_recording.add(name, klass) end |
#reset! ⇒ Object
23 24 25 26 |
# File 'lib/bogus/public_methods.rb', line 23 def reset! clear @injector = Bogus::Injector.new end |
#reset_overwritten_classes ⇒ Object
77 78 79 |
# File 'lib/bogus/public_methods.rb', line 77 def reset_overwritten_classes inject.resets_overwritten_classes.reset end |
#reset_stubbed_methods ⇒ Object
73 74 75 |
# File 'lib/bogus/public_methods.rb', line 73 def reset_stubbed_methods inject.resets_stubbed_methods.reset_all_doubles end |
#verify_contract!(fake_name) ⇒ Object
11 12 13 |
# File 'lib/bogus/public_methods.rb', line 11 def verify_contract!(fake_name) inject.verifies_contracts.verify(fake_name) end |