Class: RSpec::SleepingKingStudios::Matchers::Core::DeepMatcher
- Parent Namespace
- RSpec::SleepingKingStudios::Matchers::Core
- Inherited Classes
- RSpec::SleepingKingStudios::Matchers::BaseMatcher
>
Object
- Defined In
- lib/rspec/sleeping_king_studios/matchers/core/deep_matcher.rb
Table Of Contents
Overview
Matcher for performing a deep comparison between two objects.
Since
Back To Top
Constants
DEFAULT_EXPECTED_ITEMS
= Object.new
- Inherited From
- RSpec::SleepingKingStudios::Matchers::Description
Since
Back To Top
Constructor
#initialize(expected) => DeepMatcher
Parameters
- expected (Object) — the expected object.
Returns
- (DeepMatcher) — a new instance of DeepMatcher
Since
Back To Top
Instance Attributes
#actual => Object (readonly)
- Inherited From
- RSpec::SleepingKingStudios::Matchers::BaseMatcher
Since
Back To Top
Instance Methods
#description => Object
Since
#does_not_match?(actual) => Boolean
Inverse of #matches? method.
Parameters
- actual (Object) — the object to check.
Returns
- (Boolean) — true if the actual object does not match the
expectation, otherwise true.
See Also
Since
#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.
Since
#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.
Since
#matches?(actual) => Boolean
Performs a deep comparison between the actual object and the expected
object. The type of comparison depends on the type of the expected object:
- If the expected object is an RSpec matcher, the #matches? method on the
matcher is called with the expected object.
- If the expected object is an Array, then each item is compared based on
the type of the expected item.
- If the expected object is a Hash, then the keys must match and each
value is compared based on the type of the expected value.
- Otherwise, the two objects are compared using an equality comparison.
Parameters
- actual (Object) — the object to check.
Returns
- (Boolean) — true if the actual object matches the expectation,
otherwise false.
Since
Back To Top
Back to
Documentation |
Versions |
2.8 |
Reference
|
RSpec
|
RSpec::SleepingKingStudios
|
RSpec::SleepingKingStudios::Matchers
|
RSpec::SleepingKingStudios::Matchers::Core