Class: RSpec::SleepingKingStudios::Matchers::Core::BeBooleanMatcher
- Inherits:
-
BaseMatcher
- Object
- BaseMatcher
- RSpec::SleepingKingStudios::Matchers::Core::BeBooleanMatcher
- Defined in:
- lib/rspec/sleeping_king_studios/matchers/core/be_boolean_matcher.rb
Overview
Matcher for testing whether an object is true or false.
Constant Summary
Constants included from Description
Description::DEFAULT_EXPECTED_ITEMS
Instance Attribute Summary
Attributes inherited from BaseMatcher
Instance Method Summary collapse
- #description ⇒ Object
-
#failure_message ⇒ Object
Message for when the object does not match, but was expected to.
-
#failure_message_when_negated ⇒ Object
Message for when the object matches, but was expected not to.
-
#matches?(actual) ⇒ Boolean
Checks if the object is true or false.
Methods inherited from BaseMatcher
Instance Method Details
#description ⇒ Object
12 13 14 |
# File 'lib/rspec/sleeping_king_studios/matchers/core/be_boolean_matcher.rb', line 12 def description 'be true or false' end |
#failure_message ⇒ Object
Message for when the object does not match, but was expected to. Make sure to always call #matches? first to set up the matcher state.
28 29 30 |
# File 'lib/rspec/sleeping_king_studios/matchers/core/be_boolean_matcher.rb', line 28 def "expected #{@actual.inspect} to be true or false" end |
#failure_message_when_negated ⇒ Object
Message for when the object matches, but was expected not to. Make sure to always call #matches? first to set up the matcher state.
33 34 35 |
# File 'lib/rspec/sleeping_king_studios/matchers/core/be_boolean_matcher.rb', line 33 def "expected #{@actual.inspect} not to be true or false" end |
#matches?(actual) ⇒ Boolean
Checks if the object is true or false.
21 22 23 24 25 |
# File 'lib/rspec/sleeping_king_studios/matchers/core/be_boolean_matcher.rb', line 21 def matches? actual super true === actual || false === actual end |