Double#with sets the expectation that the Double will receive the passed in arguments.
Passing in a block sets the return value.
mock(subject).method_name.with(1, 2) {:return_value}
# File lib/rr/double_definitions/double_definition.rb, line 62 62: def with(*args, &return_value_block) 63: @argument_expectation = Expectations::ArgumentEqualityExpectation.new(*args) 64: install_method_callback return_value_block 65: self 66: end
Double#with_any_args sets the expectation that the Double can receive any arguments.
Passing in a block sets the return value.
mock(subject).method_name.with_any_args {:return_value}
# File lib/rr/double_definitions/double_definition.rb, line 74 74: def with_any_args(&return_value_block) 75: @argument_expectation = Expectations::AnyArgumentExpectation.new 76: install_method_callback return_value_block 77: self 78: end
Double#with_no_args sets the expectation that the Double will receive no arguments.
Passing in a block sets the return value.
mock(subject).method_name.with_no_args {:return_value}
# File lib/rr/double_definitions/double_definition.rb, line 86 86: def with_no_args(&return_value_block) 87: @argument_expectation = Expectations::ArgumentEqualityExpectation.new() 88: install_method_callback return_value_block 89: self 90: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.