I have a macro for test purposes that creates a navigation controller, sets it as the root view controller of the main window and put the view controller being tested inside the navigation controller.
I also would like to for every invocation of pushViewController:animated:
to change the animated parameter to NO
.
How can I achieve that?
I tried using stub:withBlock:
and then calling the pushViewController:animated:
inside the block with the view controller being pushed (params[0]) and NO but this leads to an infinite loop.
There is also the stub:withArguments:
but in that case I don't have the reference to the view controller being pushed since it's a macro used in several places.
The only way I could think about it is to use the stub:withBlock:
and inside the block remove the stub and normally call pushViewController:params[0]:NO
but I couldn't find a way to remove a stub.
Any help?