Exception: Assay::TrueFailure
- Inherits:
-
CompareFailure
- Object
- Exception
- Assertion
- CompareFailure
- Assay::TrueFailure
- Defined in:
- lib/assay/assertions/true_failure.rb
Overview
Constant Summary
Constants inherited from Assertion
Class Method Summary collapse
- .assertion_name ⇒ Object
- .assertion_operator ⇒ Object
-
.pass?(exp) ⇒ Boolean
Check assertion.
Instance Method Summary collapse
Methods inherited from Assertion
assert, #assert, assertable_method, #assertion?, #fail?, fail?, #initialize, #negative?, #pass?, refute, #refute, #set_arguments, #set_negative, to_matcher
Constructor Details
This class inherits a constructor from Assay::Assertion
Class Method Details
.assertion_name ⇒ Object
13 14 15 |
# File 'lib/assay/assertions/true_failure.rb', line 13 def self.assertion_name :true end |
.assertion_operator ⇒ Object
17 18 19 |
# File 'lib/assay/assertions/true_failure.rb', line 17 def self.assertion_operator :true? end |
.pass?(exp) ⇒ Boolean
Check assertion.
22 23 24 |
# File 'lib/assay/assertions/true_failure.rb', line 22 def self.pass?(exp) TrueClass === exp end |
Instance Method Details
#to_s ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/assay/assertions/true_failure.rb', line 27 def to_s return super unless @arguments.size == 1 exp = @arguments[0].inspect if @_negated "Expected #{exp} to NOT be true" else "Expected #{exp} to be true" end end |