RSpec

Library providing tools for writing and running RSpec tests.

Class: RSpec::SleepingKingStudios::Matchers::Core::HavePredicateMatcher

Parent Namespace
RSpec::SleepingKingStudios::Matchers::Core
Inherited Classes
RSpec::SleepingKingStudios::Matchers::BaseMatcher > Object
Included Modules
RSpec::Matchers::Composable, RSpec::SleepingKingStudios::Matchers::Shared::MatchProperty
Defined In
lib/rspec/sleeping_king_studios/matchers/core/have_predicate_matcher.rb

Table Of Contents

Overview

Matcher for testing whether an object has a specific predicate, e.g. responds to :property?.

Since

Back To Top

Constants

DEFAULT_EXPECTED_ITEMS

= Object.new

Inherited From
RSpec::SleepingKingStudios::Matchers::Description

Since

Back To Top

Constructor

#initialize expected => HavePredicateMatcher

Parameters

Returns

Since

Back To Top

Instance Attributes

#actual => Object (readonly)

Inherited From
RSpec::SleepingKingStudios::Matchers::BaseMatcher

Since

Back To Top

Instance Methods

#description => String

Generates a description of the matcher expectation.

Returns

Since

#does_not_match? actual => Boolean

Inherited From
RSpec::SleepingKingStudios::Matchers::BaseMatcher

Inverse of #matches? method.

Parameters

Returns

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

Checks if the object responds to #expected?. Additionally, if a value expectation is set, compares the value of #expected to the specified value.

Parameters

Returns

Since

#with_value value => HaveReaderMatcher

Also known as: with

Sets a value expectation. The matcher will compare the value from #property? with the specified value.

Parameters

Returns

Since

Back To Top


Back to Documentation | Reference | RSpec | RSpec::SleepingKingStudios | RSpec::SleepingKingStudios::Matchers | RSpec::SleepingKingStudios::Matchers::Core