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
#failure_message_when_negated, #initialize
Constructor Details
This class inherits a constructor from Crspec::Matchers::BaseMatcher
Instance Method Details
#failure_message ⇒ Object
48 49 50 |
# File 'lib/crspec/matchers.rb', line 48 def "Expected #{@expected.inspect} (object_id: #{@expected.object_id}), got #{@actual.inspect} (object_id: #{@actual.object_id})" end |
#matches?(actual) ⇒ Boolean
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/crspec/matchers.rb', line 37 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 |