Displaying 1 result from an estimated 1 matches for "method_name_or_hash".
2007 Aug 08
1
Mocking Time, delegating to original object
...ssing around with the teardown order, I decided to modify
the Expectation with a new method, .stops_mocking.
Here are the changes I use, including a few monkey patches to push
relevant objects down to where I want them, all wrapped up in a big
ugly file.
module Mocha
class Mock
def expects(method_name_or_hash, backtrace = nil, stub_method = nil)
@stub_method = stub_method
if method_name_or_hash.is_a?(Hash) then
method_name_or_hash.each do |method_name, return_value|
add_expectation(Expectation.new(self, method_name,
backtrace).returns(return_value))
end
else...