RSpec

Library providing tools for writing and running RSpec tests.

Class: RSpec::SleepingKingStudios::Matchers::Core::DelegateMethodMatcher

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

Table Of Contents

Overview

Matcher for testing whether an object delegates a method to the specified other object.

Since

Back To Top

Constants

DEFAULT_EXPECTED_ITEMS

= Object.new

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

Since

DEFAULT_EXPECTED_RETURN

= Object.new.freeze

Since

Back To Top

Constructor

#initialize expected => DelegateMethodMatcher

Parameters

Returns

Since

Back To Top

Instance Attributes

#actual => Object (readonly)

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

Since

#expected => Object (readonly)

Also known as: method_name

method initialize

Since

Back To Top

Instance Methods

#and_return => DelegateMethodMatcher

Specifies that the actual method, when called, will return the specified value. If more than one return value is specified, the method will be called one time for each return value, and on the Nth call must return the Nth specified return value.

from calling the method on the actual object.

Parameters

Returns

Since

#description => Object

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

Tests the actual object to see if it matches the defined condition(s). Invoked by RSpec expectations.

Parameters

Returns

Raises

Since

#to target => DelegateMethodMatcher

Specifies the target object. The expected methods should be delegated from the actual object to the target.

Parameters

Returns

Since

#with_a_block => DelegateMethodMatcher

Also known as: and_a_block

Specifies that a block argument must be passed in to the target when calling the method on the actual object.

Returns

Since

#with_arguments => DelegateMethodMatcher

Also known as: and_arguments

Specifies a list of arguments. The provided arguments are passed in to the method call when calling the method on the actual object, and must be passed on to the target.

Parameters

Returns

Since

#with_keywords => DelegateMethodMatcher

Also known as: and_keywords

Specifies a hash of keywords and values. The provided keywords are passed in to the method call when calling the method on the actual object, and must be passed on to the target.

Parameters

Returns

Since

Back To Top


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