Library providing tools for writing and running RSpec tests.
Matcher for testing whether an object delegates a method to the specified other object.
DEFAULT_EXPECTED_ITEMS
= Object.new
DEFAULT_EXPECTED_RETURN
= Object.new.freeze
#initialize expected => DelegateMethodMatcher
#actual => Object (readonly)
#expected => Object (readonly)
Also known as:
method_name
method initialize
#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.
#description => Object
#does_not_match? actual => Boolean
Inverse of #matches? method.
#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.
#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.
#matches? actual => Boolean
Tests the actual object to see if it matches the defined condition(s). Invoked by RSpec expectations.
#to target => DelegateMethodMatcher
Specifies the target object. The expected methods should be delegated from the actual object to the target.
#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.
#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.
#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.
Back to Documentation | Reference | RSpec | RSpec::SleepingKingStudios | RSpec::SleepingKingStudios::Matchers | RSpec::SleepingKingStudios::Matchers::Core