Class: Lookout::Difference::Lookout::Reception

Inherits:
Range show all
Defined in:
lib/lookout-3.0/difference/lookout/reception.rb

Overview

Difference reports between Receptions. Differences are seen when the number of times a method call is received isn’t within the range of expected number of receptions.

Instance Attribute Summary

Attributes inherited from Object

#actual, #expected

Instance Method Summary collapse

Methods inherited from Object

#==, #hash, #message, #to_s

Constructor Details

#initialize(actual, expected) ⇒ Reception

Initializes a difference report between the ACTUAL number of receptions against the range of EXPECTED number of receptions.

Parameters:

  • actual (Integer)
  • expected (Range)


11
12
13
14
# File 'lib/lookout-3.0/difference/lookout/reception.rb', line 11

def initialize(actual, expected)
  super actual, expected.range
  @reception = expected
end

Instance Method Details

#diffEnumerable<::String>

Returns An Enumerable containing the difference report message generated from the method mock.

Returns:

  • (Enumerable<::String>)

    An Enumerable containing the difference report message generated from the method mock



18
19
20
# File 'lib/lookout-3.0/difference/lookout/reception.rb', line 18

def diff
  [Lookout::Reception::Error.from(@reception, actual, expected).message]
end