Class: RR::TimesCalledMatchers::NeverMatcher

Inherits:
TimesCalledMatcher show all
Includes:
Terminal
Defined in:
lib/rr/times_called_matchers/never_matcher.rb

Instance Attribute Summary

Attributes inherited from TimesCalledMatcher

#times

Instance Method Summary collapse

Methods included from Terminal

#terminal?

Methods inherited from TimesCalledMatcher

#==, #error_message, #expected_times_message

Constructor Details

#initializeNeverMatcher

Returns a new instance of NeverMatcher



6
7
8
# File 'lib/rr/times_called_matchers/never_matcher.rb', line 6

def initialize
  super 0
end

Instance Method Details

#attempt?(times_called) ⇒ Boolean

Returns:

  • (Boolean)

Raises:



18
19
20
# File 'lib/rr/times_called_matchers/never_matcher.rb', line 18

def attempt?(times_called)
  raise RR::Errors::TimesCalledError, error_message(1)
end

#matches?(times_called) ⇒ Boolean

Returns:

  • (Boolean)


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

def matches?(times_called)
  true
end

#possible_match?(times_called) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/rr/times_called_matchers/never_matcher.rb', line 10

def possible_match?(times_called)
  true
end