search for: stub_method

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

2007 Aug 08
1
Mocking Time, delegating to original object
...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 add_expectation(Expecta...
2008 Jan 28
6
client first, top down, outside in, etc with rails
I''m starting a new project and I want to try writing the client first. I.e. I want to write my ''views'' first and I would like to mock out all the models in such a way that I can run the site and browse it with the mocked out models. Is it easy to use rspec''s mocking for this sort of thing and has anyone done it before? Does anyone know of a tutorial out there