Class: RSpectacular::ActiveRecord::Matchers::TruthfulnessMatcher
- Inherits:
-
Shoulda::ActiveRecord::Matchers::ValidationMatcher
- Object
- Shoulda::ActiveRecord::Matchers::ValidationMatcher
- RSpectacular::ActiveRecord::Matchers::TruthfulnessMatcher
- Defined in:
- lib/rspectacular/matchers/active_record/truthfulness_matcher.rb
Instance Method Summary collapse
- #allows_false ⇒ Object
- #allows_true ⇒ Object
- #description ⇒ Object
- #disallows_nil ⇒ Object
- #matches?(truthable) ⇒ Boolean
Instance Method Details
#allows_false ⇒ Object
17 18 19 |
# File 'lib/rspectacular/matchers/active_record/truthfulness_matcher.rb', line 17 def allows_false allows_value_of(false) end |
#allows_true ⇒ Object
13 14 15 |
# File 'lib/rspectacular/matchers/active_record/truthfulness_matcher.rb', line 13 def allows_true allows_value_of(true) end |
#description ⇒ Object
25 26 27 |
# File 'lib/rspectacular/matchers/active_record/truthfulness_matcher.rb', line 25 def description "should accept only boolean true or false values" end |
#disallows_nil ⇒ Object
21 22 23 |
# File 'lib/rspectacular/matchers/active_record/truthfulness_matcher.rb', line 21 def disallows_nil disallows_value_of(nil) end |
#matches?(truthable) ⇒ Boolean
5 6 7 8 9 10 11 |
# File 'lib/rspectacular/matchers/active_record/truthfulness_matcher.rb', line 5 def matches?(truthable) super(truthable) allows_true && allows_false && disallows_nil end |