Class: RR::TimesCalledMatchers::TimesCalledMatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/rr/times_called_matchers/times_called_matcher.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(times) ⇒ TimesCalledMatcher

Returns a new instance of TimesCalledMatcher



16
17
18
# File 'lib/rr/times_called_matchers/times_called_matcher.rb', line 16

def initialize(times)
  @times = times
end

Instance Attribute Details

#timesObject (readonly)

Returns the value of attribute times



14
15
16
# File 'lib/rr/times_called_matchers/times_called_matcher.rb', line 14

def times
  @times
end

Instance Method Details

#==(other) ⇒ Object



30
31
32
# File 'lib/rr/times_called_matchers/times_called_matcher.rb', line 30

def ==(other)
  self.class == other.class && self.times == other.times
end

#attempt?(times_called) ⇒ Boolean

Returns:

  • (Boolean)


23
24
# File 'lib/rr/times_called_matchers/times_called_matcher.rb', line 23

def attempt?(times_called)
end

#error_message(times_called) ⇒ Object



26
27
28
# File 'lib/rr/times_called_matchers/times_called_matcher.rb', line 26

def error_message(times_called)
  "Called #{times_called.inspect} #{pluralized_time(times_called)}.\nExpected #{expected_times_message}."
end

#expected_times_messageObject



34
35
36
# File 'lib/rr/times_called_matchers/times_called_matcher.rb', line 34

def expected_times_message
  "#{@times.inspect} times"
end

#matches?(times_called) ⇒ Boolean

Returns:

  • (Boolean)


20
21
# File 'lib/rr/times_called_matchers/times_called_matcher.rb', line 20

def matches?(times_called)
end