ios - Xcode not showing OCMock verification errors in the source code -
when unit testing in xcode, if use ocunit
stassertx
methods, ochamcrest
assertions or ocmockito
, when of raise error can see xcode marks line in red in editor. however, ocmock
xcode not show line in red, have check issues tab see test method failing. know way solve this? see verify line in red when verification failing.
thanks lot.
ocmock's verify
method works throwing exception, can take advantage of.
stassertnothrows([mymock verify], @"unexpected!");
the stassertnothrows
highlighted xcode if verify
fails.
edit
a macro can make nicer:
#define stverify(mock) stassertnothrow([mock verify], @"mock failed verify") stverify(mymock);
Comments
Post a Comment