objective c - Is there a way in OCMockito to make stubs fail when an unknown method is called? -
when creating stub in ocmockito, use calls stub out method calls , return values:
[given([stubobject mymethod]) willreturn:somevalue];
the problem have if don't define method method gets called during test, default seems to return nil
. can lead sneaky bugs since real methods asserted never return nil , therefore return value not tested in code calling method.
is there way change default behavior or maybe test if called on object apart few methods i'm stubbing?
no, ocmockito stubs "nice". if want "strict" stubs, ocmock may suit better.