class RSpec::SleepingKingStudios::Matchers::BaseMatcher
Minimal implementation of the RSpec
matcher interface.
@since 1.0.0
Attributes
Public Instance Methods
Source
Source
# File lib/rspec/sleeping_king_studios/matchers/base_matcher.rb, line 42 def failure_message "expected #{@actual.inspect} to #{description}" end
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.
Source
# File lib/rspec/sleeping_king_studios/matchers/base_matcher.rb, line 48 def failure_message_when_negated "expected #{@actual.inspect} not to #{description}" end
Message for when the object matches, but was expected not to. Make sure to always call matches?
first to set up the matcher state.
Source
# File lib/rspec/sleeping_king_studios/matchers/base_matcher.rb, line 34 def matches? actual @actual = actual true end
Tests the actual object to see if it matches the defined condition(s). Invoked by RSpec
expectations.
@param [Object] actual the object to test against the matcher
@return [Boolean] true if the object matches, otherwise false