search for: add_expectation

Displaying 2 results from an estimated 2 matches for "add_expectation".

2007 Aug 08
1
Mocking Time, delegating to original object
...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 add_expectation(Expectation.new(self, method_name_or_hash, backtrace)) end end def stubs(method_name_or_hash, backtrace = nil, stub_method = nil) @stub_method = stub_method...
2007 Sep 06
1
any reason we can''t use the concise stubs on Object
...o=>"b", :again=>"hi"}, @stubbee=#<Object:0x32fc364>> is not a symbol from /opt/local/lib/ruby/gems/1.8/gems/mocha-0.5.4/lib/mocha/mock.rb:148:in `method_defined?'' from /opt/local/lib/ruby/gems/1.8/gems/mocha-0.5.4/lib/mocha/mock.rb:148:in `add_expectation'' from /opt/local/lib/ruby/gems/1.8/gems/mocha-0.5.4/lib/mocha/mock.rb:88:in `stubs'' from /opt/local/lib/ruby/gems/1.8/gems/mocha-0.5.4/lib/mocha/auto_verify.rb:65:in `stub'' from /opt/local/lib/ruby/gems/1.8/gems/mocha-0.5.4/lib/mocha/object.rb:57:i...