Exception: TrueAssay

Inherits:
BooleanAssay show all
Defined in:
lib/assay/true_assay.rb

Overview

Comparison assertion for TrueClass.

TrueAssay.pass?(true) #=> true
TrueAssay.fail?(true) #=> false
TrueAssay.pass?(1)    #=> false

Constant Summary

Constants inherited from Assertion

Assertion::SIZE_LIMIT

Constants included from Assay::Assertable

Assay::Assertable::SIZE_LIMIT

Class Method Summary collapse

Methods inherited from Assertion

by_name, by_operator, inherited, register, subclasses

Methods included from Assay::Assertable

#[], #assert!, #assert_message, #assertive_name, #assertor, #fail?, #operator, #pass?, #refute!, #refute_message

Class Method Details

.pass?(subject) ⇒ Boolean

Check assertion using ‘#true?` method.

Returns:

  • (Boolean)


16
17
18
# File 'lib/assay/true_assay.rb', line 16

def self.pass?(subject)
  subject.true?  #TrueClass === subject
end