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