Class: Crspec::Matchers::BaseMatcher
- Inherits:
-
Object
- Object
- Crspec::Matchers::BaseMatcher
- Defined in:
- lib/crspec/matchers.rb
Direct Known Subclasses
BeFalsyMatcher, BeMatcher, BeNilMatcher, BeTruthyMatcher, ChangeMatcher, EqMatcher, IncludeMatcher, RaiseErrorMatcher, RespondToMatcher
Instance Attribute Summary collapse
-
#actual ⇒ Object
readonly
Returns the value of attribute actual.
-
#expected ⇒ Object
readonly
Returns the value of attribute expected.
Instance Method Summary collapse
- #failure_message ⇒ Object
- #failure_message_when_negated ⇒ Object
-
#initialize(expected = nil) ⇒ BaseMatcher
constructor
A new instance of BaseMatcher.
Constructor Details
#initialize(expected = nil) ⇒ BaseMatcher
Returns a new instance of BaseMatcher.
8 9 10 |
# File 'lib/crspec/matchers.rb', line 8 def initialize(expected = nil) @expected = expected end |
Instance Attribute Details
#actual ⇒ Object (readonly)
Returns the value of attribute actual.
6 7 8 |
# File 'lib/crspec/matchers.rb', line 6 def actual @actual end |
#expected ⇒ Object (readonly)
Returns the value of attribute expected.
6 7 8 |
# File 'lib/crspec/matchers.rb', line 6 def expected @expected end |
Instance Method Details
#failure_message ⇒ Object
12 13 14 |
# File 'lib/crspec/matchers.rb', line 12 def "Expected #{@actual.inspect} to match #{@expected.inspect}" end |
#failure_message_when_negated ⇒ Object
16 17 18 |
# File 'lib/crspec/matchers.rb', line 16 def "Expected #{@actual.inspect} not to match #{@expected.inspect}" end |