Class: Spec::Matchers::Eql
Overview
:nodoc:
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message ⇒ Object
-
#initialize(expected) ⇒ Eql
constructor
A new instance of Eql.
- #matches?(actual) ⇒ Boolean
- #negative_failure_message ⇒ Object
Constructor Details
#initialize(expected) ⇒ Eql
Returns a new instance of Eql.
5 6 7 |
# File 'lib/spec/matchers/eql.rb', line 5 def initialize(expected) @expected = expected end |
Instance Method Details
#description ⇒ Object
22 23 24 |
# File 'lib/spec/matchers/eql.rb', line 22 def description "eql #{@expected.inspect}" end |
#failure_message ⇒ Object
14 15 16 |
# File 'lib/spec/matchers/eql.rb', line 14 def return "expected #{@expected.inspect}, got #{@actual.inspect} (using .eql?)", @expected, @actual end |
#matches?(actual) ⇒ Boolean
9 10 11 12 |
# File 'lib/spec/matchers/eql.rb', line 9 def matches?(actual) @actual = actual @actual.eql?(@expected) end |
#negative_failure_message ⇒ Object
18 19 20 |
# File 'lib/spec/matchers/eql.rb', line 18 def return "expected #{@actual.inspect} not to equal #{@expected.inspect} (using .eql?)", @expected, @actual end |