Class: BeSameValueAs
- Inherits:
-
Object
- Object
- BeSameValueAs
- Includes:
- AssertValueAssertion
- Defined in:
- lib/assert_value.rb
Overview
RSpec matcher for assert_value
Instance Method Summary collapse
- #failure_message_for_should ⇒ Object
- #failure_message_for_should_not ⇒ Object
-
#initialize(expected) ⇒ BeSameValueAs
constructor
A new instance of BeSameValueAs.
- #matches?(target) ⇒ Boolean
Methods included from AssertValueAssertion
#assert_value, #be_same_value_as, #file_offsets
Constructor Details
#initialize(expected) ⇒ BeSameValueAs
Returns a new instance of BeSameValueAs.
458 459 460 461 |
# File 'lib/assert_value.rb', line 458 def initialize(expected) @expected = expected @rspec_matcher = true end |
Instance Method Details
#failure_message_for_should ⇒ Object
471 472 473 |
# File 'lib/assert_value.rb', line 471 def "expected to be the same" end |
#failure_message_for_should_not ⇒ Object
475 476 477 |
# File 'lib/assert_value.rb', line 475 def "expected not to be the same" end |
#matches?(target) ⇒ Boolean
463 464 465 466 467 468 469 |
# File 'lib/assert_value.rb', line 463 def matches?(target) if target.is_a? Proc assert_value @expected, &target else assert_value target, @expected end end |