Class: Minicrest::Truthy
- Defined in:
- lib/minicrest/value_matchers.rb
Overview
Matcher that checks Ruby truthiness.
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message(actual) ⇒ Object
- #matches?(actual) ⇒ Boolean
- #negated_failure_message(actual) ⇒ Object
Methods inherited from Matcher
Instance Method Details
#description ⇒ Object
31 32 33 |
# File 'lib/minicrest/value_matchers.rb', line 31 def description 'truthy' end |
#failure_message(actual) ⇒ Object
35 36 37 |
# File 'lib/minicrest/value_matchers.rb', line 35 def (actual) "expected #{actual.inspect} to be truthy" end |
#matches?(actual) ⇒ Boolean
27 28 29 |
# File 'lib/minicrest/value_matchers.rb', line 27 def matches?(actual) !!actual end |
#negated_failure_message(actual) ⇒ Object
39 40 41 |
# File 'lib/minicrest/value_matchers.rb', line 39 def (actual) "expected #{actual.inspect} not to be truthy, but it was" end |