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
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::DoubleDefinitionCreate::DoubleDefinitionCreateError
RR::DoubleDefinitions::DoubleDefinitionCreate::StrategySetupMethods
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::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::Extensions
RR::Injections
RR::Injections::DoubleInjection
RR::Injections::Injection
RR::Injections::MethodMissingInjection
RR::Injections::SingletonMethodAddedInjection
RR::MethodDispatches
RR::MethodDispatches::BaseMethodDispatch
RR::MethodDispatches::MethodDispatch
RR::MethodDispatches::MethodMissingDispatch
RR::ProcFromBlock
RR::RecordedCalls
RR::Space
RR::Space::Reader
RR::SpyVerification
RR::SpyVerificationProxy
RR::TimesCalledMatchers
RR::TimesCalledMatchers::AnyTimesMatcher
RR::TimesCalledMatchers::AtLeastMatcher
RR::TimesCalledMatchers::AtMostMatcher
RR::TimesCalledMatchers::IntegerMatcher
RR::TimesCalledMatchers::NeverMatcher
RR::WildcardMatchers
RR::WildcardMatchers::Anything
RR::WildcardMatchers::Boolean
RR::WildcardMatchers::DuckType
RR::WildcardMatchers::HashIncluding
RR::WildcardMatchers::IsA
RR::WildcardMatchers::Numeric
RR::WildcardMatchers::Satisfy
Range
Regexp
Methods
::included — RR::Adapters::Rspec
::included — RR::Adapters::TestUnit
::included — RR::Adapters::MiniTest
::instance — RR::Space
::method_missing — RR::Space
::new — RR::DoubleDefinitions::Strategies::Strategy
::new — RR::Space
::new — RR::Injections::DoubleInjection
::new — RR::MethodDispatches::MethodMissingDispatch
::new — RR::SpyVerification
::new — RR::DoubleDefinitions::DoubleDefinitionCreate
::new — RR::SpyVerificationProxy
::new — RR::MethodDispatches::MethodDispatch
::new — RR::WildcardMatchers::IsA
::new — RR::Injections::SingletonMethodAddedInjection
::new — RR::WildcardMatchers::Numeric
::new — RR::WildcardMatchers::Satisfy
::new — RR::WildcardMatchers::DuckType
::new — RR::Adapters::Rspec::InvocationMatcher
::new — RR::DoubleDefinitions::ChildDoubleDefinitionCreate
::new — RR::TimesCalledMatchers::AnyTimesMatcher
::new — RR::TimesCalledMatchers::NeverMatcher
::new — RR::RecordedCalls
::new — RR::WildcardMatchers::HashIncluding
::new — RR::Double
::new — RR::Injections::MethodMissingInjection
#<< — RR::RecordedCalls
#== — RR::WildcardMatchers::DuckType
#== — RR::WildcardMatchers::HashIncluding
#== — RR::ProcFromBlock
#== — RR::WildcardMatchers::Anything
#== — RR::RecordedCalls
#== — RR::WildcardMatchers::Satisfy
#== — RR::WildcardMatchers::IsA
#== — RR::WildcardMatchers::Boolean
#__double_definition_create__ — RR::DoubleDefinitions::DoubleDefinitionCreateBlankSlate
#add_double_injection_strategy — RR::DoubleDefinitions::DoubleDefinitionCreate::StrategySetupMethods
#add_implementation_strategy — RR::DoubleDefinitions::DoubleDefinitionCreate::StrategySetupMethods
#add_strategy — RR::DoubleDefinitions::DoubleDefinitionCreate::StrategySetupMethods
#add_strategy — RR::DoubleDefinitions::ChildDoubleDefinitionCreate
#add_verification_strategy — RR::DoubleDefinitions::DoubleDefinitionCreate::StrategySetupMethods
#after_call — RR::DoubleDefinitions::DoubleDefinition::DefinitionConstructionMethods
#all_instances_of — RR::DoubleDefinitions::DoubleDefinitionCreate
#all_instances_of — RR::Adapters::RRMethods
#any? — RR::RecordedCalls
#any_instance_of — RR::DoubleDefinitions::DoubleDefinitionCreate
#any_instance_of — RR::Adapters::RRMethods
#any_instance_of! — RR::DoubleDefinitions::Strategies::StrategyMethods
#any_number_of_times — RR::DoubleDefinitions::DoubleDefinition::TimesDefinitionConstructionMethods
#any_times — RR::DoubleDefinitions::DoubleDefinition::TimesDefinitionConstructionMethods
#any_times — RR::Adapters::RRMethods
#anything — RR::Adapters::RRMethods
#args — RR::Double
#argument_expectation — RR::Double
#arity_matches? — RR::Double
#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::NeverMatcher
#attempt? — RR::TimesCalledMatchers::IntegerMatcher
#attempt? — RR::Double
#attempt? — RR::TimesCalledMatchers::AtMostMatcher
#backtrace — RR::Errors::RRError
#bind — RR::Injections::MethodMissingInjection
#bind — RR::Injections::SingletonMethodAddedInjection
#bind — RR::Injections::DoubleInjection
#bind_method — RR::Injections::DoubleInjection
#bind_method — RR::Injections::MethodMissingInjection
#bind_method_that_self_destructs_and_delegates_to_method_missing — RR::Injections::DoubleInjection
#bind_method_with_alias — RR::Injections::DoubleInjection
#blank_slate_whitelist — RR::Space
#boolean — RR::Adapters::RRMethods
#call — RR::MethodDispatches::MethodDispatch
#call — RR::SpyVerification
#call — RR::DoubleDefinitions::DoubleInjections::AnyInstanceOf
#call — RR::DoubleDefinitions::DoubleInjections::Instance
#call — RR::MethodDispatches::BaseMethodDispatch
#call — RR::BlankSlate
#call — RR::MethodDispatches::MethodMissingDispatch
#call — RR::DoubleDefinitions::Strategies::Strategy
#call — RR::DoubleDefinitions::DoubleDefinitionCreate
#call_implementation — RR::MethodDispatches::MethodMissingDispatch
#call_implementation — RR::MethodDispatches::MethodDispatch
#call_original_method — RR::MethodDispatches::MethodDispatch
#call_original_method — RR::MethodDispatches::MethodMissingDispatch
#call_original_method_missing — RR::MethodDispatches::BaseMethodDispatch
#call_yields — RR::MethodDispatches::BaseMethodDispatch
#class_instance_method_defined — RR::ClassInstanceMethodDefined
#clear — RR::RecordedCalls
#default_double_injection_strategy — RR::DoubleDefinitions::DoubleDefinitionCreate
#deferred_bind_method — RR::Injections::DoubleInjection
#dispatch_method — RR::Injections::DoubleInjection
#dispatch_method_delegates_to_dispatch_original_method — RR::Injections::DoubleInjection
#dispatch_original_method — RR::Injections::DoubleInjection
#do_call — RR::DoubleDefinitions::Strategies::Verification::DontAllow
#do_call — RR::DoubleDefinitions::Strategies::Implementation::StronglyTypedReimplementation
#do_call — RR::DoubleDefinitions::Strategies::Verification::Stub
#do_call — RR::DoubleDefinitions::Strategies::Implementation::Proxy
#do_call — RR::DoubleDefinitions::Strategies::Verification::Mock
#do_call — RR::DoubleDefinitions::Strategies::DoubleInjection::AnyInstanceOf
#do_call — RR::DoubleDefinitions::Strategies::Implementation::Reimplementation
#do_call — RR::DoubleDefinitions::Strategies::DoubleInjection::Instance
#do_call — RR::DoubleDefinitions::Strategies::Strategy
#dont_allow — RR::DoubleDefinitions::DoubleDefinitionCreate
#dont_allow — RR::Adapters::RRMethods
#dont_allow! — RR::DoubleDefinitions::Strategies::StrategyMethods
#double_injection — RR::MethodDispatches::MethodMissingDispatch
#double_injection_exists_error — RR::RecordedCalls
#double_injection_strategy= — RR::DoubleDefinitions::DoubleDefinitionCreate::StrategySetupMethods
#double_not_found_error — RR::MethodDispatches::BaseMethodDispatch
#duck_type — RR::Adapters::RRMethods
#eql? — RR::WildcardMatchers::HashIncluding
#eql? — RR::WildcardMatchers::IsA
#eql? — RR::WildcardMatchers::Anything
#eql? — RR::WildcardMatchers::Satisfy
#eql? — RR::WildcardMatchers::DuckType
#eql? — RR::WildcardMatchers::Boolean
#exact_match? — RR::DoubleDefinitions::DoubleDefinition::StateQueryMethods
#exact_match? — RR::Double
#exists? — RR::Injections::MethodMissingInjection
#exists? — RR::Injections::SingletonMethodAddedInjection
#exists? — RR::Injections::DoubleInjection
#exists_by_subject? — RR::Injections::DoubleInjection
#expected_arguments — RR::DoubleDefinitions::DoubleDefinition::StateQueryMethods
#expected_arguments — RR::Double
#expected_times_message — RR::TimesCalledMatchers::AtMostMatcher
#expected_times_message — RR::TimesCalledMatchers::AtLeastMatcher
#expected_times_message — RR::TimesCalledMatchers::AnyTimesMatcher
#extract_subject_from_return_value — RR::MethodDispatches::BaseMethodDispatch
#find — RR::Injections::DoubleInjection
#find — RR::Injections::SingletonMethodAddedInjection
#find_all_matches — RR::DoubleMatches
#find_by_subject — RR::Injections::DoubleInjection
#find_double_to_attempt — RR::MethodDispatches::BaseMethodDispatch
#find_or_create — RR::Injections::MethodMissingInjection
#find_or_create — RR::Injections::DoubleInjection
#find_or_create — RR::Injections::SingletonMethodAddedInjection
#find_or_create_by_subject — RR::Injections::DoubleInjection
#formatted_name — RR::Double
#hash_including — RR::Adapters::RRMethods
#have_received — RR::Adapters::Rspec
#implementation_is_original_method? — RR::Double
#implementation_is_original_method? — RR::DoubleDefinitions::DoubleDefinition::StateQueryMethods
#implementation_is_original_method? — RR::MethodDispatches::BaseMethodDispatch
#implementation_strategy — RR::DoubleDefinitions::DoubleDefinition::StateQueryMethods
#implementation_strategy= — RR::DoubleDefinitions::DoubleDefinitionCreate::StrategySetupMethods
#implemented_by — RR::DoubleDefinitions::DoubleDefinition::DefinitionConstructionMethods
#implemented_by_original_method — RR::DoubleDefinitions::DoubleDefinition::DefinitionConstructionMethods
#inspect — RR::WildcardMatchers::IsA
#inspect — RR::WildcardMatchers::Satisfy
#inspect — RR::WildcardMatchers::Anything
#inspect — RR::WildcardMatchers::HashIncluding
#inspect — RR::WildcardMatchers::Boolean
#inspect — RR::WildcardMatchers::Numeric
#inspect — RR::WildcardMatchers::DuckType
#install_method_callback — RR::DoubleDefinitions::DoubleDefinition::DefinitionConstructionMethods
#install_method_callback — RR::SpyVerification
#instance_of — RR::DoubleDefinitions::DoubleDefinitionCreate
#instance_of — RR::Adapters::RRMethods
#instance_of — RR::DoubleDefinitions::ChildDoubleDefinitionCreate
#instance_of! — RR::DoubleDefinitions::Strategies::StrategyMethods
#instances — RR::Injections::Injection
#instances — RR::Injections::DoubleInjection
#invocation_count_error — RR::RecordedCalls
#is_a — RR::Adapters::RRMethods
#is_a_boolean? — RR::WildcardMatchers::Boolean
#lately_bound_alias_method — RR::DoubleDefinitions::Strategies::StrategyMethods
#list_message_part — RR::Double
#match_argument_expectation — RR::RecordedCalls
#match_double_injection — RR::RecordedCalls
#match_error — RR::RecordedCalls
#matches? — RR::TimesCalledMatchers::IntegerMatcher
#matches? — RR::TimesCalledMatchers::NeverMatcher
#matches? — RR::TimesCalledMatchers::AtMostMatcher
#matches? — RR::Adapters::Rspec::InvocationMatcher
#matches? — RR::TimesCalledMatchers::AnyTimesMatcher
#matches? — RR::TimesCalledMatchers::AtLeastMatcher
#matching_recorded_calls — RR::RecordedCalls
#method_call — RR::Double
#method_missing — RR::SpyVerificationProxy
#method_missing — RR::Injections::MethodMissingInjection
#method_missing — RR::DoubleDefinitions::DoubleDefinitionCreateBlankSlate
#method_missing — RR::Adapters::Rspec::InvocationMatcher
#method_name — RR::Double
#method_name — RR::DoubleDefinitions::DoubleDefinitionCreate
#mock — RR::Adapters::RRMethods
#mock — RR::DoubleDefinitions::DoubleDefinitionCreate
#mock! — RR::DoubleDefinitions::Strategies::StrategyMethods
#never — RR::DoubleDefinitions::DoubleDefinition::TimesDefinitionConstructionMethods
#new_instance_of — RR::Adapters::RRMethods
#nil? — RR::Adapters::Rspec::InvocationMatcher
#no_subject? — RR::DoubleDefinitions::DoubleDefinitionCreate::StrategySetupMethods
#numeric — RR::Adapters::RRMethods
#once — RR::DoubleDefinitions::DoubleDefinition::TimesDefinitionConstructionMethods
#ordered — RR::DoubleDefinitions::DoubleDefinition::DefinitionConstructionMethods
#ordered — RR::SpyVerification
#ordered? — RR::SpyVerification
#ordered? — RR::DoubleDefinitions::DoubleDefinition::StateQueryMethods
#ordered? — RR::Double
#ordered_match_error — RR::RecordedCalls
#original_method — RR::Injections::Injection
#original_method_alias_name — RR::Injections::MethodMissingInjection
#original_method_alias_name — RR::Injections::DoubleInjection
#original_method_alias_name — RR::Injections::SingletonMethodAddedInjection
#original_method_missing_alias_name — RR::MethodDispatches::MethodMissingDispatch
#permissive_argument — RR::DoubleDefinitions::Strategies::Strategy
#possible_match? — RR::TimesCalledMatchers::IntegerMatcher
#possible_match? — RR::TimesCalledMatchers::AtMostMatcher
#possible_match? — RR::TimesCalledMatchers::NeverMatcher
#proxy — RR::Adapters::RRMethods
#proxy — RR::DoubleDefinitions::DoubleDefinitionCreate
#proxy! — RR::DoubleDefinitions::Strategies::StrategyMethods
#received — RR::Adapters::RRMethods
#record_call — RR::Space
#register_double — RR::Injections::DoubleInjection
#register_ordered_double — RR::Space
#reimplementation — RR::DoubleDefinitions::Strategies::Strategy
#reset — RR::Adapters::RRMethods
#reset — RR::Space
#reset — RR::Injections::SingletonMethodAddedInjection
#reset — RR::Injections::DoubleInjection
#reset — RR::Injections::MethodMissingInjection
#reset_bound_objects — RR::Space
#reset_double — RR::Space
#reset_double — RR::Injections::DoubleInjection
#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 — RR::DoubleDefinitions::DoubleDefinitionCreate
#root_subject — RR::DoubleDefinitions::ChildDoubleDefinitionCreate
#satisfy — RR::Adapters::RRMethods
#set_argument_expectation_for_args — RR::SpyVerification
#set_default_double_injection_strategy — RR::DoubleDefinitions::DoubleDefinitionCreate
#setup_mocks_for_rspec — RR::Adapters::Rspec
#setup_with_rr — RR::Adapters::TestUnit
#setup_with_rr — RR::Adapters::MiniTest
#space — RR::Space::Reader
#spy — RR::Adapters::RRMethods
#strong — RR::Adapters::RRMethods
#strong — RR::DoubleDefinitions::DoubleDefinition::DefinitionConstructionMethods
#strong — RR::DoubleDefinitions::DoubleDefinitionCreate
#strong! — RR::DoubleDefinitions::Strategies::StrategyMethods
#strong? — RR::DoubleDefinitions::DoubleDefinition::StateQueryMethods
#stub — RR::Adapters::RRMethods
#stub — RR::DoubleDefinitions::DoubleDefinitionCreate
#stub! — RR::DoubleDefinitions::Strategies::StrategyMethods
#subject — RR::DoubleDefinitions::Strategies::Strategy
#subject_accepts_only_varargs? — RR::Double
#subject_accepts_varargs? — RR::Double
#subject_arity — RR::Double
#subject_has_method_defined? — RR::Injections::Injection
#subject_has_original_method? — RR::Injections::Injection
#subject_has_original_method_missing? — RR::Injections::DoubleInjection
#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? — RR::Double
#then — RR::DoubleDefinitions::DoubleDefinition::DefinitionConstructionMethods
#times — RR::DoubleDefinitions::DoubleDefinition::TimesDefinitionConstructionMethods
#times_matcher — RR::Double
#to_proc — RR::SpyVerification
#twice — RR::DoubleDefinitions::DoubleDefinition::TimesDefinitionConstructionMethods
#unordered_match_error — RR::RecordedCalls
#verbose — RR::DoubleDefinitions::DoubleDefinition::DefinitionConstructionMethods
#verbose? — RR::DoubleDefinitions::DoubleDefinition::StateQueryMethods
#verbose? — RR::Double
#verification_strategy= — RR::DoubleDefinitions::DoubleDefinitionCreate::StrategySetupMethods
#verify — RR::Space
#verify — RR::Adapters::RRMethods
#verify — RR::Double
#verify — RR::Injections::DoubleInjection
#verify_argument_expectation_is_set — RR::Double
#verify_double — RR::Injections::DoubleInjection
#verify_double — RR::Space
#verify_doubles — RR::Space
#verify_method_signature — RR::Double
#verify_method_signature — RR::DoubleDefinitions::DoubleDefinition::DefinitionConstructionMethods
#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 — RR::Double
#wildcard_match? — Regexp
#wildcard_match? — RR::WildcardMatchers::IsA
#wildcard_match? — RR::WildcardMatchers::HashIncluding
#wildcard_match? — RR::WildcardMatchers::Boolean
#wildcard_match? — RR::WildcardMatchers::Anything
#wildcard_match? — RR::WildcardMatchers::Satisfy
#wildcard_match? — Range
#wildcard_match? — RR::Double
#wildcard_match? — RR::DoubleDefinitions::DoubleDefinition::StateQueryMethods
#wildcard_match? — RR::WildcardMatchers::DuckType
#with — RR::DoubleDefinitions::DoubleDefinition::ArgumentDefinitionConstructionMethods
#with_any_args — RR::DoubleDefinitions::DoubleDefinition::ArgumentDefinitionConstructionMethods
#with_no_args — RR::DoubleDefinitions::DoubleDefinition::ArgumentDefinitionConstructionMethods
#yields — RR::DoubleDefinitions::DoubleDefinition::DefinitionConstructionMethods