Class | FlexMock::StubProxy |
In: |
lib/flexmock.rb
|
Parent: | Object |
StubProxy is used to mate the mock framework to an existing object. The object is "enhanced" with a reference to a mock object (stored in @flexmock_mock). When the should_receive method is sent to the proxy, it overrides the existing object‘s method by creating singleton method that forwards to the mock. When testing is complete, StubProxy will erase the mocking infrastructure from the object being stubbed (e.g. remove instance variables and mock singleton methods).
mock | [R] |
Verify that the mock has been properly called. After verification, detach the mocking infrastructure from the existing object.
Stub out the given method in the existing object and then let the mock object handle should_receive.