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

#initialize

Constructor Details

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

Instance Method Details

#failure_messageObject



27
28
29
# File 'lib/crspec/matchers.rb', line 27

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

#failure_message_when_negatedObject



31
32
33
# File 'lib/crspec/matchers.rb', line 31

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

#matches?(actual) ⇒ Boolean

Returns:

  • (Boolean)


22
23
24
25
# File 'lib/crspec/matchers.rb', line 22

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