Module: Sinclair::Matchers::MethodTo Private

Included in:
AddMethodTo, ChangeMethodOn
Defined in:
lib/sinclair/matchers/method_to.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Common methods on final matchers

Instance Method Summary collapse

Instance Method Details

#failure_messageString

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Used for other versions of rspec

Some versions call failure_message, others call failure_message_for_should

Returns:

  • (String)


15
16
17
# File 'lib/sinclair/matchers/method_to.rb', line 15

def failure_message
  failure_message_for_should
end

#failure_message_when_negatedString

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Used for other versions of rspec

Some versions call failure_message_when_negated, others call failure_message_for_should_not

Returns:

  • (String)


25
26
27
# File 'lib/sinclair/matchers/method_to.rb', line 25

def failure_message_when_negated
  failure_message_for_should_not
end

#matches?(event_proc) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Checks if expectation is true or not

Returns:

  • (Boolean)

    expectation check



32
33
34
35
36
37
38
# File 'lib/sinclair/matchers/method_to.rb', line 32

def matches?(event_proc)
  return false unless event_proc.is_a?(Proc)

  raise_block_syntax_error if block_given?
  perform_change(event_proc)
  check
end