Class: Whitestone::Assertion::Identity
- Defined in:
- lib/whitestone/assertion_classes.rb
Overview
class Assertion::FloatEqual
Instance Method Summary collapse
-
#initialize(mode, *args, &block) ⇒ Identity
constructor
A new instance of Identity.
- #message ⇒ Object
- #run ⇒ Object
Methods inherited from Base
Methods included from Guards
#args_or_block_one_only, #block_required, #no_block_allowed, #one_argument, #two_arguments, #two_or_three_arguments, #type_check
Constructor Details
#initialize(mode, *args, &block) ⇒ Identity
Returns a new instance of Identity.
338 339 340 341 342 |
# File 'lib/whitestone/assertion_classes.rb', line 338 def initialize(mode, *args, &block) super @obj1, @obj2 = two_arguments(args) no_block_allowed end |
Instance Method Details
#message ⇒ Object
346 347 348 349 350 351 352 353 354 355 356 357 358 |
# File 'lib/whitestone/assertion_classes.rb', line 346 def String.new.tap { |str| case @mode when :assert str << Col["Identity test failed -- the two objects are NOT the same"].yb str << Col["\n Object 1 id: ", @obj1.object_id].fmt('yb,rb') str << Col["\n Object 2 id: ", @obj2.object_id].fmt('yb,rb') when :negate str << Col["Identity test failed -- the two objects ARE the same"].yb str << Col["\n Object id: ", @obj1.object_id].fmt('yb,rb') end } end |