Exception: IdentityAssay
- Inherits:
-
EqualityAssay
- Object
- Exception
- Assertion
- LikeAssay
- EqualAssay
- EqualityAssay
- IdentityAssay
- Defined in:
- lib/assay/identity_assay.rb
Overview
Check that two objects are one and the same object.
NOTE: Ruby defines #equal? to mean #identical? but I believe
this to be a misnomer, at the very least. So we use the term
identical instead.
Constant Summary
Constants inherited from Assertion
Constants included from Assay::Assertable
Class Method Summary collapse
-
.pass?(subject, criterion) ⇒ Boolean
Check assertion using
object_id == object_id.
Methods inherited from EqualAssay
Methods inherited from Assertion
by_name, by_operator, inherited, #initialize, name_index, operator_index, register, subclasses
Methods included from Assay::Assertable
#[], #assert!, #assert_message, #assertive_name, #assertor, #extract_options, #fail?, #operator, #pass?, #refute!, #refute_message, #standard_message
Methods inherited from Exception
#negative?, raised?, #set_negative
Constructor Details
This class inherits a constructor from Assertion
Class Method Details
.pass?(subject, criterion) ⇒ Boolean
Check assertion using object_id == object_id.
16 17 18 |
# File 'lib/assay/identity_assay.rb', line 16 def self.pass?(subject, criterion) subject.identical?(criterion) #subject.object_id == criterion.object_id end |