Class: VerifiedDouble::RecordedMethodSignatureRegistry
- Inherits:
-
Array
- Object
- Array
- VerifiedDouble::RecordedMethodSignatureRegistry
- Defined in:
- lib/verified_double/recorded_method_signature_registry.rb
Instance Attribute Summary collapse
-
#current_double ⇒ Object
Returns the value of attribute current_double.
Instance Method Summary collapse
- #add_method_signature(a_double, method) ⇒ Object
- #add_method_signature_with_current_double(method) ⇒ Object
- #update_current_double(a_double) ⇒ Object
Instance Attribute Details
#current_double ⇒ Object
Returns the value of attribute current_double.
3 4 5 |
# File 'lib/verified_double/recorded_method_signature_registry.rb', line 3 def current_double @current_double end |
Instance Method Details
#add_method_signature(a_double, method) ⇒ Object
5 6 7 8 |
# File 'lib/verified_double/recorded_method_signature_registry.rb', line 5 def add_method_signature(a_double, method) simple_double = SimpleDouble.new(a_double) self << simple_double.build_recorded_method_signature(method) end |
#add_method_signature_with_current_double(method) ⇒ Object
10 11 12 |
# File 'lib/verified_double/recorded_method_signature_registry.rb', line 10 def add_method_signature_with_current_double(method) add_method_signature(current_double, method) end |
#update_current_double(a_double) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/verified_double/recorded_method_signature_registry.rb', line 14 def update_current_double(a_double) if VerifiedDouble.doubles_in_current_test.include?(a_double) VerifiedDouble.registry.current_double = a_double else VerifiedDouble.registry.current_double = nil end end |