Class: Bogus::Interaction::InteractionComparator

Inherits:
Object
  • Object
show all
Defined in:
lib/bogus/stubbing/interaction.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#recordedObject (readonly)

Returns the value of attribute recorded.



28
29
30
# File 'lib/bogus/stubbing/interaction.rb', line 28

def recorded
  @recorded
end

#stubbedObject (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

Returns:

  • (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