Class: BeSameValueAs
Overview
RSpec matcher for assert_value
Instance Method Summary
collapse
#assert_value, #be_same_value_as, #file_offsets
Constructor Details
453
454
455
456
|
# File 'lib/assert_value.rb', line 453
def initialize(expected)
@expected = expected
@rspec_matcher = true
end
|
Instance Method Details
#failure_message ⇒ Object
466
467
468
|
# File 'lib/assert_value.rb', line 466
def failure_message
"expected to be the same"
end
|
#failure_message_when_negated ⇒ Object
470
471
472
|
# File 'lib/assert_value.rb', line 470
def failure_message_when_negated
"expected not to be the same"
end
|
#matches?(target) ⇒ Boolean
458
459
460
461
462
463
464
|
# File 'lib/assert_value.rb', line 458
def matches?(target)
if target.is_a? Proc
assert_value @expected, &target
else
assert_value target, @expected
end
end
|
#supports_block_expectations? ⇒ Boolean
474
475
476
|
# File 'lib/assert_value.rb', line 474
def supports_block_expectations?
true
end
|