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

- (TimesCalledMatcher) initialize(times)



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

def initialize(times)
  @times = times
end

Instance Attribute Details

- (Object) times (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

- (Object) ==(other)



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

- (Boolean) attempt?(times_called)



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

def attempt?(times_called)
end

- (Object) error_message(times_called)



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

- (Object) expected_times_message



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

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

- (Boolean) matches?(times_called)



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

def matches?(times_called)
end