SenTestCasehas a method -[SenTestCase raiseAfterFailure]that causes STAssert...an exception to be thrown at the end, preventing the execution of the next line in the test.
You can do this based on a test:
- (void)testSomeStuff
{
[self raiseAfterFailure];
STAssertTrue([myobject succeeded], @"failed");
STAssertNotNil(foo,@"bar");
}
Or at the class level:
- (void)setUp
{
[super setUp];
[self raiseAfterFailure];
}
source
share