Class: RTest::Equal
- Inherits:
-
Object
- Object
- RTest::Equal
- Defined in:
- lib/rtest/equal.rb
Constant Summary collapse
- FAILURE_MESSAGE_FOR_TO =
"does not match, expecting {match}, got {compare}"
- FAILURE_MESSAGE_FOR_NOT_TO =
"match, expecting somthing different to {match}, got {compare}"
- SUCCESS_MESSAGE_FOR_TO =
"objects match"
- SUCCESS_MESSAGE_FOR_NOT_TO =
"objects does not match"
Instance Method Summary collapse
- #failure_message_for_not_to ⇒ Object
- #failure_message_for_to ⇒ Object
-
#initialize(object) ⇒ Equal
constructor
A new instance of Equal.
- #match?(compare_object) ⇒ Boolean
- #success_message_for_not_to ⇒ Object
- #success_message_for_to ⇒ Object
Constructor Details
#initialize(object) ⇒ Equal
Returns a new instance of Equal.
9 10 11 |
# File 'lib/rtest/equal.rb', line 9 def initialize(object) @match_object = object end |
Instance Method Details
#failure_message_for_not_to ⇒ Object
22 23 24 |
# File 'lib/rtest/equal.rb', line 22 def substitute_comparisons(FAILURE_MESSAGE_FOR_NOT_TO) end |
#failure_message_for_to ⇒ Object
18 19 20 |
# File 'lib/rtest/equal.rb', line 18 def substitute_comparisons(FAILURE_MESSAGE_FOR_TO) end |
#match?(compare_object) ⇒ Boolean
13 14 15 16 |
# File 'lib/rtest/equal.rb', line 13 def match?(compare_object) @compare_object = compare_object @match_object == @compare_object end |
#success_message_for_not_to ⇒ Object
30 31 32 |
# File 'lib/rtest/equal.rb', line 30 def SUCCESS_MESSAGE_FOR_NOT_TO end |
#success_message_for_to ⇒ Object
26 27 28 |
# File 'lib/rtest/equal.rb', line 26 def SUCCESS_MESSAGE_FOR_TO end |