Class: Crspec::Matchers::EqMatcher

Inherits:
BaseMatcher show all
Defined in:
lib/crspec/matchers.rb

Instance Attribute Summary

Attributes inherited from BaseMatcher

#actual, #expected

Instance Method Summary collapse

Methods inherited from BaseMatcher

#and, #initialize, #or

Constructor Details

This class inherits a constructor from Crspec::Matchers::BaseMatcher

Instance Method Details

#failure_messageObject



77
78
79
# File 'lib/crspec/matchers.rb', line 77

def failure_message
  "Expected #{@expected.inspect}, got #{@actual.inspect}"
end

#failure_message_when_negatedObject



81
82
83
# File 'lib/crspec/matchers.rb', line 81

def failure_message_when_negated
  "Expected value not to equal #{@expected.inspect}"
end

#matches?(actual) ⇒ Boolean

Returns:

  • (Boolean)


72
73
74
75
# File 'lib/crspec/matchers.rb', line 72

def matches?(actual)
  @actual = actual
  @actual == @expected
end