Object
# File lib/rspec/mocks/matchers/receive.rb, line 5 def initialize(message, block) @message = message @block = block @recorded_customizations = [] # MRI, JRuby and RBX report the caller inconsistently; MRI # reports an extra "in `new'" line in the backtrace that the # others do not include. The safest way to find the right # line is to search for the first line BEFORE rspec/mocks/syntax.rb. @backtrace_line = caller.find do |line| !line.split(':').first.end_with?('rspec/mocks/syntax.rb') end end
# File lib/rspec/mocks/matchers/receive.rb, line 33 def setup_allowance(subject, &block) setup_mock_proxy_method_substitute(subject, :add_stub, block) end
# File lib/rspec/mocks/matchers/receive.rb, line 45 def setup_any_instance_allowance(subject, &block) setup_any_instance_method_substitute(subject, :stub, block) end
# File lib/rspec/mocks/matchers/receive.rb, line 37 def setup_any_instance_expectation(subject, &block) setup_any_instance_method_substitute(subject, :should_receive, block) end
# File lib/rspec/mocks/matchers/receive.rb, line 41 def setup_any_instance_negative_expectation(subject, &block) setup_any_instance_method_substitute(subject, :should_not_receive, block) end
# File lib/rspec/mocks/matchers/receive.rb, line 19 def setup_expectation(subject, &block) setup_mock_proxy_method_substitute(subject, :add_message_expectation, block) end
# File lib/rspec/mocks/matchers/receive.rb, line 24 def setup_negative_expectation(subject, &block) # ensure `never` goes first for cases like `never.and_return(5)`, # where `and_return` is meant to raise an error @recorded_customizations.unshift Customization.new(:never, [], nil) setup_expectation(subject, &block) end
Generated with the Darkfish Rdoc Generator 2.