RR mock and stub

17 Mar 2013

stub() is for replacing the method implementation

mock().a_method.with_any_args is for replacing the method implementation AND expecting the method to be called once; You may use mock().twice in order to expect it to be called twice.

Give it a kudos