Class: Matchi::Equal
- Inherits:
- BasicObject
- Defined in:
- lib/matchi/equal.rb
Overview
Identity matcher.
Instance Method Summary collapse
-
#initialize(expected) ⇒ Equal
constructor
Initialize the matcher with an object.
-
#matches? ⇒ Boolean
Comparison between actual and expected values.
Constructor Details
#initialize(expected) ⇒ Equal
Initialize the matcher with an object.
10 11 12 |
# File 'lib/matchi/equal.rb', line 10 def initialize(expected) @expected = expected end |
Instance Method Details
#matches? ⇒ Boolean
Returns Comparison between actual and expected values.
21 22 23 |
# File 'lib/matchi/equal.rb', line 21 def matches? @expected.equal?(yield) end |