Class: EqualMatcher
- Defined in:
- lib/extensions/rhospec/rhospec.rb,
lib/extensions/mspec/mspec/matchers/equal.rb
Instance Method Summary collapse
- #failure_message ⇒ Object
-
#initialize(expected) ⇒ EqualMatcher
constructor
A new instance of EqualMatcher.
- #matches?(actual) ⇒ Boolean
- #negative_failure_message ⇒ Object
Constructor Details
#initialize(expected) ⇒ EqualMatcher
Returns a new instance of EqualMatcher.
427 428 429 |
# File 'lib/extensions/rhospec/rhospec.rb', line 427 def initialize(expected) @expected = expected end |
Instance Method Details
#failure_message ⇒ Object
436 437 438 439 |
# File 'lib/extensions/rhospec/rhospec.rb', line 436 def ["Expected #{@actual.pretty_inspect}", "to be identical to #{@expected.pretty_inspect}"] end |
#matches?(actual) ⇒ Boolean
431 432 433 434 |
# File 'lib/extensions/rhospec/rhospec.rb', line 431 def matches?(actual) @actual = actual @actual.equal?(@expected) end |
#negative_failure_message ⇒ Object
441 442 443 444 |
# File 'lib/extensions/rhospec/rhospec.rb', line 441 def ["Expected #{@actual.pretty_inspect}", "not to be identical to #{@expected.pretty_inspect}"] end |