Table of Contents - rr-1.0.4 Documentation
Pages
CHANGES
README
RR
More Information
Mailing Lists
Websites
What is a Test Double?
Using RR
test/unit
rspec
standalone
Syntax between RR and other double/mock frameworks
Terse Syntax
Double Injections (a.k.a Partial Mocking)
Pure Mock objects
No should_receive or expects method
with method call is not necessary
using a block to set the return value
Using RR
mock
stub
dont_allow - aliased with do_not_allow, dont_call, and do_not_call
mock.proxy
stub.proxy
any_instance_of
new_instance_of
Spies
test/unit
rspec
Block Syntax
Block Syntax with explicit DoubleDefinitionCreatorProxy argument
Double Graphs
Argument Wildcard matchers
anything
is_a
numeric
boolean
duck_type
Ranges
Regexps
hash_including
satisfy
Writing your own Argument Matchers
Invocation Amount Wildcard Matchers
any_times
Special Thanks To
Classes/Modules
DoubleDefinitionCreateError
Object
RR
RR::Adapters
RR::Adapters::MiniTest
RR::Adapters::RRMethods
RR::Adapters::Rspec
RR::Adapters::Rspec::InvocationMatcher
RR::Adapters::TestUnit
RR::BlankSlate
RR::ClassInstanceMethodDefined
RR::Double
RR::DoubleDefinitions
RR::DoubleDefinitions::ChildDoubleDefinitionCreate
RR::DoubleDefinitions::DoubleDefinition
RR::DoubleDefinitions::DoubleDefinition::ArgumentDefinitionConstructionMethods
RR::DoubleDefinitions::DoubleDefinition::DefinitionConstructionMethods
RR::DoubleDefinitions::DoubleDefinition::StateQueryMethods
RR::DoubleDefinitions::DoubleDefinition::TimesDefinitionConstructionMethods
RR::DoubleDefinitions::DoubleDefinitionCreate
RR::DoubleDefinitions::DoubleDefinitionCreateBlankSlate
RR::DoubleDefinitions::DoubleInjections
RR::DoubleDefinitions::DoubleInjections::AnyInstanceOf
RR::DoubleDefinitions::DoubleInjections::Instance
RR::DoubleDefinitions::Strategies
RR::DoubleDefinitions::Strategies::DoubleInjection
RR::DoubleDefinitions::Strategies::DoubleInjection::AnyInstanceOf
RR::DoubleDefinitions::Strategies::DoubleInjection::DoubleInjectionStrategy
RR::DoubleDefinitions::Strategies::DoubleInjection::Instance
RR::DoubleDefinitions::Strategies::DoubleInjection::Instance::subject;
RR::DoubleDefinitions::Strategies::Implementation
RR::DoubleDefinitions::Strategies::Implementation::ImplementationStrategy
RR::DoubleDefinitions::Strategies::Implementation::Proxy
RR::DoubleDefinitions::Strategies::Implementation::Reimplementation
RR::DoubleDefinitions::Strategies::Implementation::StronglyTypedReimplementation
RR::DoubleDefinitions::Strategies::Strategy
RR::DoubleDefinitions::Strategies::StrategyMethods
RR::DoubleDefinitions::Strategies::Verification
RR::DoubleDefinitions::Strategies::Verification::DontAllow
RR::DoubleDefinitions::Strategies::Verification::Mock
RR::DoubleDefinitions::Strategies::Verification::Stub
RR::DoubleDefinitions::Strategies::Verification::VerificationStrategy
RR::DoubleMatches
RR::Errors
RR::Errors::ArgumentEqualityError
RR::Errors::DoubleDefinitionError
RR::Errors::DoubleNotFoundError
RR::Errors::DoubleOrderError
RR::Errors::RRError
RR::Errors::SpyVerificationErrors
RR::Errors::SpyVerificationErrors::DoubleInjectionNotFoundError
RR::Errors::SpyVerificationErrors::InvocationCountError
RR::Errors::SpyVerificationErrors::SpyVerificationError
RR::Errors::SubjectDoesNotImplementMethodError
RR::Errors::SubjectHasDifferentArityError
RR::Errors::TimesCalledError
RR::Expectations
RR::Expectations::AnyArgumentExpectation
RR::Expectations::ArgumentEqualityExpectation
RR::Expectations::TimesCalledExpectation
RR::Extensions
RR::HashWithObjectIdKey
RR::Injections
RR::Injections::DoubleInjection
RR::Injections::Injection
RR::Injections::MethodMissingInjection
RR::Injections::SingletonMethodAddedInjection
RR::Injections::subject;
RR::MethodDispatches
RR::MethodDispatches::BaseMethodDispatch
RR::MethodDispatches::MethodDispatch
RR::MethodDispatches::MethodMissingDispatch
RR::ProcFromBlock
RR::RecordedCalls
RR::Space
RR::Space::Reader
RR::Space::subject;
RR::SpyVerification
RR::SpyVerificationProxy
RR::TimesCalledMatchers
RR::TimesCalledMatchers::AnyTimesMatcher
RR::TimesCalledMatchers::AtLeastMatcher
RR::TimesCalledMatchers::AtMostMatcher
RR::TimesCalledMatchers::IntegerMatcher
RR::TimesCalledMatchers::NeverMatcher
RR::TimesCalledMatchers::NonTerminal
RR::TimesCalledMatchers::ProcMatcher
RR::TimesCalledMatchers::RangeMatcher
RR::TimesCalledMatchers::Terminal
RR::TimesCalledMatchers::TimesCalledMatcher
RR::WildcardMatchers
Writing your own custom wildcard matchers.
(other)
.initialize
#==(other)
#inspect
#wildcard_matches?(other)
A finishing touch: wrapping it neatly
Recap
RR::WildcardMatchers::Anything
RR::WildcardMatchers::Boolean
RR::WildcardMatchers::DuckType
RR::WildcardMatchers::HashIncluding
RR::WildcardMatchers::IsA
RR::WildcardMatchers::Numeric
RR::WildcardMatchers::Satisfy
Range
Regexp
StrategySetupMethods
Methods
::included — RR::Adapters::MiniTest
::included — RR::Adapters::Rspec
::included — RR::Adapters::TestUnit
::instance — RR::Space
::method_missing — RR::Space
::new — RR::MethodDispatches::MethodMissingDispatch
::new — RR::DoubleDefinitions::Strategies::Strategy
::new — RR::RecordedCalls
::new — RR::Adapters::Rspec::InvocationMatcher
::new — RR::WildcardMatchers::HashIncluding
::new — Object
::new — RR::WildcardMatchers::IsA
::new — RR::MethodDispatches::MethodDispatch
::new — RR::WildcardMatchers::Numeric
::new — RR::Space
::new — RR::SpyVerification
::new — RR::WildcardMatchers::Satisfy
::new — RR::DoubleDefinitions::ChildDoubleDefinitionCreate
::new — RR::SpyVerificationProxy
::new — RR::TimesCalledMatchers::AnyTimesMatcher
::new — RR::WildcardMatchers::DuckType
::new — RR
::new — RR::TimesCalledMatchers::NeverMatcher
#<< — RR::RecordedCalls
#== — RR::WildcardMatchers::HashIncluding
#== — RR::WildcardMatchers::DuckType
#== — RR::ProcFromBlock
#== — RR::WildcardMatchers::Anything
#== — RR::WildcardMatchers::Satisfy
#== — RR
#== — RR::WildcardMatchers::Boolean
#== — RR::RecordedCalls
#== — RR::WildcardMatchers::IsA
#__double_definition_create__ — RR::DoubleDefinitions::DoubleDefinitionCreateBlankSlate
#add_double_injection_strategy — StrategySetupMethods
#add_implementation_strategy — StrategySetupMethods
#add_strategy — StrategySetupMethods
#add_strategy — RR::DoubleDefinitions::ChildDoubleDefinitionCreate
#add_verification_strategy — StrategySetupMethods
#after_call — RR::DoubleDefinitions::DoubleDefinition::DefinitionConstructionMethods
#all_instances_of — Object
#all_instances_of — RR::Adapters::RRMethods
#any? — RR::RecordedCalls
#any_instance_of — RR::Adapters::RRMethods
#any_instance_of — Object
#any_instance_of! — RR::DoubleDefinitions
#any_number_of_times — RR::DoubleDefinitions::DoubleDefinition::TimesDefinitionConstructionMethods
#any_times — RR::Adapters::RRMethods
#any_times — RR::DoubleDefinitions::DoubleDefinition::TimesDefinitionConstructionMethods
#anything — RR::Adapters::RRMethods
#args — Object
#argument_expectation — Object
#arity_matches? — Object
#assert_received — RR::Adapters::MiniTest
#assert_received — RR::Adapters::TestUnit
#at_least — RR::DoubleDefinitions::DoubleDefinition::TimesDefinitionConstructionMethods
#at_most — RR::DoubleDefinitions::DoubleDefinition::TimesDefinitionConstructionMethods
#attempt? — RR::TimesCalledMatchers::IntegerMatcher
#attempt? — RR::TimesCalledMatchers::NeverMatcher
#attempt? — Object
#attempt? — RR::TimesCalledMatchers::AtMostMatcher
#attempt? — RR
#backtrace — RR::Errors::RRError
#bind — RR
#bind_method — RR
#bind_method_that_self_destructs_and_delegates_to_method_missing — RR
#bind_method_with_alias — RR
#blank_slate_whitelist — RR::Space
#boolean — RR::Adapters::RRMethods
#call — RR::MethodDispatches::MethodMissingDispatch
#call — Object
#call — RR::DoubleDefinitions::Strategies::Strategy
#call — RR::MethodDispatches::MethodDispatch
#call — RR::MethodDispatches::BaseMethodDispatch
#call — RR::SpyVerification
#call_implementation — RR::MethodDispatches::MethodDispatch
#call_implementation — RR::MethodDispatches::MethodMissingDispatch
#call_original_method — RR::MethodDispatches::MethodMissingDispatch
#call_original_method — RR::MethodDispatches::MethodDispatch
#call_original_method_missing — RR::MethodDispatches::BaseMethodDispatch
#call_yields — RR::MethodDispatches::BaseMethodDispatch
#class_instance_method_defined — RR::ClassInstanceMethodDefined
#clear — RR::RecordedCalls
#deferred_bind_method — RR
#dispatch_method — RR::Injections
#dispatch_method — RR
#dispatch_method_delegates_to_dispatch_original_method — RR
#dispatch_original_method — RR
#do_call — RR::DoubleDefinitions::Strategies::Implementation::StronglyTypedReimplementation
#do_call — RR::DoubleDefinitions::Strategies::DoubleInjection::Instance
#do_call — RR::DoubleDefinitions::Strategies::Strategy
#do_call — RR::DoubleDefinitions::Strategies::Implementation::Reimplementation
#do_call — RR::DoubleDefinitions::Strategies::Implementation::Proxy
#do_call — RR::DoubleDefinitions::Strategies::DoubleInjection::AnyInstanceOf
#do_call — RR::DoubleDefinitions::Strategies::Verification::Mock
#do_call — RR::DoubleDefinitions::Strategies::Verification::DontAllow
#do_call — RR::DoubleDefinitions::Strategies::Verification::Stub
#dont_allow — Object
#dont_allow — RR::Adapters::RRMethods
#dont_allow! — RR::DoubleDefinitions
#double_injection — RR::MethodDispatches::MethodMissingDispatch
#double_injection_exists_error — RR::RecordedCalls
#double_injection_strategy= — StrategySetupMethods
#double_not_found_error — RR::MethodDispatches::BaseMethodDispatch
#duck_type — RR::Adapters::RRMethods
#eql? — RR::WildcardMatchers::IsA
#eql? — RR::WildcardMatchers::HashIncluding
#eql? — RR::WildcardMatchers::Satisfy
#eql? — RR::WildcardMatchers::DuckType
#eql? — RR::WildcardMatchers::Boolean
#eql? — RR::WildcardMatchers::Anything
#error_message — RR
#exact_match? — Object
#exact_match? — RR::DoubleDefinitions::DoubleDefinition::StateQueryMethods
#exists? — RR::Injections
#exists_by_subject? — RR::Injections
#expected_arguments — RR::DoubleDefinitions::DoubleDefinition::StateQueryMethods
#expected_arguments — Object
#expected_times_message — RR::TimesCalledMatchers::AtMostMatcher
#expected_times_message — RR
#expected_times_message — RR::TimesCalledMatchers::AnyTimesMatcher
#expected_times_message — RR::TimesCalledMatchers::AtLeastMatcher
#extract_subject_from_return_value — RR::MethodDispatches::BaseMethodDispatch
#find — RR::Injections
#find_all_matches — RR::DoubleMatches
#find_by_subject — RR::Injections
#find_double_to_attempt — RR::MethodDispatches::BaseMethodDispatch
#find_or_create_by_subject — RR::Injections
#formatted_name — Object
#hash_including — RR::Adapters::RRMethods
#have_received — RR::Adapters::Rspec
#implementation_is_original_method? — RR::MethodDispatches::BaseMethodDispatch
#implementation_is_original_method? — Object
#implementation_is_original_method? — RR::DoubleDefinitions::DoubleDefinition::StateQueryMethods
#implementation_strategy — RR::DoubleDefinitions::DoubleDefinition::StateQueryMethods
#implementation_strategy= — StrategySetupMethods
#implemented_by — RR::DoubleDefinitions::DoubleDefinition::DefinitionConstructionMethods
#implemented_by_original_method — RR::DoubleDefinitions::DoubleDefinition::DefinitionConstructionMethods
#inspect — RR::WildcardMatchers::Numeric
#inspect — RR::WildcardMatchers::Anything
#inspect — RR::WildcardMatchers::HashIncluding
#inspect — RR::WildcardMatchers::Satisfy
#inspect — RR::WildcardMatchers::DuckType
#inspect — RR::WildcardMatchers::Boolean
#inspect — RR::WildcardMatchers::IsA
#install_method_callback — RR::SpyVerification
#install_method_callback — RR::DoubleDefinitions::DoubleDefinition::DefinitionConstructionMethods
#instance_of — RR::Adapters::RRMethods
#instance_of — Object
#instance_of — RR::DoubleDefinitions::ChildDoubleDefinitionCreate
#instance_of! — RR::DoubleDefinitions
#instances — RR::Injections
#invocation_count_error — RR::RecordedCalls
#is_a — RR::Adapters::RRMethods
#is_a_boolean? — RR::WildcardMatchers::Boolean
#list_message_part — RR
#match_argument_expectation — RR::RecordedCalls
#match_double_injection — RR::RecordedCalls
#match_error — RR::RecordedCalls
#matches? — RR::TimesCalledMatchers::AtLeastMatcher
#matches? — RR::TimesCalledMatchers::AtMostMatcher
#matches? — RR::TimesCalledMatchers::IntegerMatcher
#matches? — RR
#matches? — RR::TimesCalledMatchers::AnyTimesMatcher
#matches? — RR::TimesCalledMatchers::NeverMatcher
#matches? — RR::Adapters::Rspec::InvocationMatcher
#matching_recorded_calls — RR::RecordedCalls
#method_call — Object
#method_missing — RR
#method_missing — RR::SpyVerificationProxy
#method_missing — RR::Adapters::Rspec::InvocationMatcher
#method_missing — RR::DoubleDefinitions::DoubleDefinitionCreateBlankSlate
#method_name — Object
#mock — Object
#mock — RR::Adapters::RRMethods
#mock! — RR::DoubleDefinitions
#never — RR::DoubleDefinitions::DoubleDefinition::TimesDefinitionConstructionMethods
#new_instance_of — RR::Adapters::RRMethods
#nil? — RR::Adapters::Rspec::InvocationMatcher
#no_subject? — StrategySetupMethods
#numeric — RR::Adapters::RRMethods
#once — RR::DoubleDefinitions::DoubleDefinition::TimesDefinitionConstructionMethods
#ordered — RR::SpyVerification
#ordered — RR::DoubleDefinitions::DoubleDefinition::DefinitionConstructionMethods
#ordered? — Object
#ordered? — RR::SpyVerification
#ordered? — RR::DoubleDefinitions::DoubleDefinition::StateQueryMethods
#ordered_match_error — RR::RecordedCalls
#original_method — RR::Injections::Injection
#original_method_alias_name — RR
#permissive_argument — RR::DoubleDefinitions::Strategies::Strategy
#pluralized_time — RR
#possible_match? — RR::TimesCalledMatchers::AtMostMatcher
#possible_match? — RR::TimesCalledMatchers::IntegerMatcher
#possible_match? — RR::TimesCalledMatchers::NeverMatcher
#proxy — Object
#proxy — RR::Adapters::RRMethods
#proxy! — RR::DoubleDefinitions
#received — RR::Adapters::RRMethods
#record_call — RR::Space
#register_double — RR
#register_ordered_double — RR::Space
#reimplementation — RR::DoubleDefinitions::Strategies::Strategy
#reset — RR
#reset — RR::Space
#reset — RR::Adapters::RRMethods
#reset — RR::Injections
#reset_bound_objects — RR::Space
#reset_double — RR::Injections
#reset_double — RR::Space
#reset_method_missing_injections — RR::Space
#reset_ordered_doubles — RR::Space
#reset_recorded_calls — RR::Space
#reset_singleton_method_added_injections — RR::Space
#returns — RR::DoubleDefinitions::DoubleDefinition::DefinitionConstructionMethods
#root_subject — Object
#root_subject — RR::DoubleDefinitions::ChildDoubleDefinitionCreate
#satisfy — RR::Adapters::RRMethods
#set_argument_expectation_for_args — RR::SpyVerification
#set_default_double_injection_strategy — RR
#setup_mocks_for_rspec — RR::Adapters::Rspec
#setup_with_rr — RR::Adapters::MiniTest
#setup_with_rr — RR::Adapters::TestUnit
#space — RR::Space::Reader
#spy — RR::Adapters::RRMethods
#strong — RR::DoubleDefinitions::DoubleDefinition::DefinitionConstructionMethods
#strong — Object
#strong — RR::Adapters::RRMethods
#strong! — RR::DoubleDefinitions
#strong? — RR::DoubleDefinitions::DoubleDefinition::StateQueryMethods
#stub — RR::Adapters::RRMethods
#stub — Object
#stub! — RR::DoubleDefinitions
#subject — RR::DoubleDefinitions::Strategies::Strategy
#subject_accepts_only_varargs? — Object
#subject_accepts_varargs? — Object
#subject_arity — Object
#subject_has_method_defined? — RR::Injections::Injection
#subject_has_original_method? — RR::Injections::Injection
#subject_has_original_method_missing? — RR
#subject_respond_to_method? — RR::Injections::Injection
#teardown_mocks_for_rspec — RR::Adapters::Rspec
#teardown_with_rr — RR::Adapters::MiniTest
#teardown_with_rr — RR::Adapters::TestUnit
#terminal? — RR::DoubleDefinitions::DoubleDefinition::StateQueryMethods
#terminal? — Object
#then — RR::DoubleDefinitions::DoubleDefinition::DefinitionConstructionMethods
#times — RR::DoubleDefinitions::DoubleDefinition::TimesDefinitionConstructionMethods
#times_matcher — Object
#to_proc — RR::SpyVerification
#twice — RR::DoubleDefinitions::DoubleDefinition::TimesDefinitionConstructionMethods
#unordered_match_error — RR::RecordedCalls
#verbose — RR::DoubleDefinitions::DoubleDefinition::DefinitionConstructionMethods
#verbose? — Object
#verbose? — RR::DoubleDefinitions::DoubleDefinition::StateQueryMethods
#verification_strategy= — StrategySetupMethods
#verify — RR
#verify — RR::Injections
#verify — Object
#verify — RR::Adapters::RRMethods
#verify — RR::Space
#verify_argument_expectation_is_set — Object
#verify_double — RR::Injections
#verify_double — RR::Space
#verify_doubles — RR::Space
#verify_method_signature — RR::DoubleDefinitions::DoubleDefinition::DefinitionConstructionMethods
#verify_method_signature — Object
#verify_method_signature? — RR::DoubleDefinitions::DoubleDefinition::StateQueryMethods
#verify_mocks_for_rspec — RR::Adapters::Rspec
#verify_ordered_double — RR::Space
#verify_subject — RR::DoubleDefinitions::Strategies::Strategy
#verify_times_matcher_is_set — Object
#wildcard_match? — RR::WildcardMatchers::Boolean
#wildcard_match? — RR::DoubleDefinitions::DoubleDefinition::StateQueryMethods
#wildcard_match? — RR::WildcardMatchers::Anything
#wildcard_match? — RR::WildcardMatchers::HashIncluding
#wildcard_match? — RR::WildcardMatchers::DuckType
#wildcard_match? — RR::WildcardMatchers::Satisfy
#wildcard_match? — RR::WildcardMatchers::IsA
#wildcard_match? — Regexp
#wildcard_match? — Range
#wildcard_match? — Object
#with — RR::DoubleDefinitions::DoubleDefinition::ArgumentDefinitionConstructionMethods
#with_any_args — RR::DoubleDefinitions::DoubleDefinition::ArgumentDefinitionConstructionMethods
#with_no_args — RR::DoubleDefinitions::DoubleDefinition::ArgumentDefinitionConstructionMethods
#yields — RR::DoubleDefinitions::DoubleDefinition::DefinitionConstructionMethods