Class: Bogus::Interaction::InteractionComparator
- Inherits:
-
Object
- Object
- Bogus::Interaction::InteractionComparator
- Defined in:
- lib/bogus/stubbing/interaction.rb
Instance Attribute Summary collapse
-
#recorded ⇒ Object
readonly
Returns the value of attribute recorded.
-
#stubbed ⇒ Object
readonly
Returns the value of attribute stubbed.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ InteractionComparator
constructor
A new instance of InteractionComparator.
- #same? ⇒ Boolean
Constructor Details
#initialize(opts = {}) ⇒ InteractionComparator
Returns a new instance of InteractionComparator.
30 31 32 33 |
# File 'lib/bogus/stubbing/interaction.rb', line 30 def initialize(opts = {}) @recorded = opts.fetch(:recorded) @stubbed = opts.fetch(:stubbed) end |
Instance Attribute Details
#recorded ⇒ Object (readonly)
Returns the value of attribute recorded.
28 29 30 |
# File 'lib/bogus/stubbing/interaction.rb', line 28 def recorded @recorded end |
#stubbed ⇒ Object (readonly)
Returns the value of attribute stubbed.
28 29 30 |
# File 'lib/bogus/stubbing/interaction.rb', line 28 def stubbed @stubbed end |
Instance Method Details
#same? ⇒ Boolean
35 36 37 38 39 |
# File 'lib/bogus/stubbing/interaction.rb', line 35 def same? return false unless recorded.method == stubbed.method return false unless same_result? same_args? end |