Class: Crspec::Matchers::BeMatcher
- Inherits:
-
BaseMatcher
- Object
- BaseMatcher
- Crspec::Matchers::BeMatcher
- Defined in:
- lib/crspec/matchers.rb
Instance Attribute Summary
Attributes inherited from BaseMatcher
Instance Method Summary collapse
Methods inherited from BaseMatcher
#and, #failure_message_when_negated, #initialize, #or
Constructor Details
This class inherits a constructor from Crspec::Matchers::BaseMatcher
Instance Method Details
#failure_message ⇒ Object
98 99 100 |
# File 'lib/crspec/matchers.rb', line 98 def "Expected #{@expected.inspect} (object_id: #{@expected.object_id}), got #{@actual.inspect} (object_id: #{@actual.object_id})" end |
#matches?(actual) ⇒ Boolean
87 88 89 90 91 92 93 94 95 96 |
# File 'lib/crspec/matchers.rb', line 87 def matches?(actual) @actual = actual if @expected.nil? && !instance_variable_defined?(:@expected) true elsif @expected.equal?(true) || @expected.equal?(false) @actual == @expected else @actual.equal?(@expected) end end |