Exception: Assay::EmptyFailure
- Defined in:
- lib/assay/assertions/empty_failure.rb
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
7 8 9 |
# File 'lib/assay/assertions/empty_failure.rb', line 7 def self.assertion_name :empty end |
.assertion_operator ⇒ Object
11 12 13 |
# File 'lib/assay/assertions/empty_failure.rb', line 11 def self.assertion_operator :empty? end |
.pass?(exp) ⇒ Boolean
Check assertion.
16 17 18 |
# File 'lib/assay/assertions/empty_failure.rb', line 16 def self.pass?(exp) exp.empty? end |
Instance Method Details
#to_s ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/assay/assertions/empty_failure.rb', line 21 def to_s return @mesg if @mesg return super unless @arguments.size == 1 exp = @arguments.first.inspect if @_negated "Expected #{exp} to NOT be empty" else "Expected #{exp} to be empty" end end |