Class: EqualMatcher

Inherits:
Object show all
Defined in:
lib/extensions/rhospec/rhospec.rb,
lib/extensions/mspec/mspec/matchers/equal.rb

Instance Method Summary collapse

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_messageObject



436
437
438
439
# File 'lib/extensions/rhospec/rhospec.rb', line 436

def failure_message
  ["Expected #{@actual.pretty_inspect}",
   "to be identical to #{@expected.pretty_inspect}"]
end

#matches?(actual) ⇒ Boolean

Returns:

  • (Boolean)


431
432
433
434
# File 'lib/extensions/rhospec/rhospec.rb', line 431

def matches?(actual)
  @actual = actual
  @actual.equal?(@expected)
end

#negative_failure_messageObject



441
442
443
444
# File 'lib/extensions/rhospec/rhospec.rb', line 441

def negative_failure_message
  ["Expected #{@actual.pretty_inspect}",
   "not to be identical to #{@expected.pretty_inspect}"]
end