Displaying 2 results from an estimated 2 matches for "unmock".
Did you mean:
unlock
2007 Dec 05
9
Does mock_model''s :null_object option work?
...just trying to get past the untested/un-speced cruft quickly to write the spec for my new code, so I''m looking for expediency over prettiness.
I''m specifying
before( :each ) do
@order_address = mock_model( OrderAddress, :null_object => TRUE )
end
but finding that unstubbed/unmocked method calls on @order_address still throw error messages like:
Mock ''OrderAddress_1026'' received unexpected message :first_name with (no args)
so I''m starting to wonder whether the :null_object option is doing anything at all....
Al
________________________...
2007 Aug 08
1
Mocking Time, delegating to original object
In my Unit tests, I run into the all-too-common problem of
Time.expects(:now) being called by Benchmark before the method is
unmocked.
Instead of messing 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...