Class: EqlMatcher
Instance Method Summary collapse
- #failure_message ⇒ Object
-
#initialize(expected) ⇒ EqlMatcher
constructor
A new instance of EqlMatcher.
- #matches?(actual) ⇒ Boolean
- #negative_failure_message ⇒ Object
Constructor Details
#initialize(expected) ⇒ EqlMatcher
Returns a new instance of EqlMatcher.
2 3 4 |
# File 'lib/extensions/mspec/mspec/matchers/eql.rb', line 2 def initialize(expected) @expected = expected end |
Instance Method Details
#failure_message ⇒ Object
11 12 13 14 |
# File 'lib/extensions/mspec/mspec/matchers/eql.rb', line 11 def ["Expected #{@actual.pretty_inspect}", "to have same value and type as #{@expected.pretty_inspect}"] end |
#matches?(actual) ⇒ Boolean
6 7 8 9 |
# File 'lib/extensions/mspec/mspec/matchers/eql.rb', line 6 def matches?(actual) @actual = actual @actual.eql?(@expected) end |
#negative_failure_message ⇒ Object
16 17 18 19 |
# File 'lib/extensions/mspec/mspec/matchers/eql.rb', line 16 def ["Expected #{@actual.pretty_inspect}", "not to have same value or type as #{@expected.pretty_inspect}"] end |