-
Notifications
You must be signed in to change notification settings - Fork 18
Documentation
has207 edited this page Feb 22, 2011
·
76 revisions
This page has moved to:
http://has207.github.com/flexmock/user-guide.html
There are times when it is useful to replace a method with a custom lambda or function in order to return custom values based on provided arguments or a global value that changes between method calls.
flexmock(some_object).should_receive('some_method').replace_with(lambda x, y, z: y == 5)
# old and deprecated
flexmock(SomeClass, new_instances=fake_object)
# new hotness
flexmock(SomeClass).new_instances(fake_object)