You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Under JUnit 3, almost all Borachio-enabled tests will take the form:
@Test // or @MediumTest and friends if using RoboGuice
def someTest {
withExpectations {
// set expectations
// run test code
}
}
It would be convenient if Borachio called resetExpectations and verifyExpectations automatically at the start and end of any methods annotated as tests.
The text was updated successfully, but these errors were encountered:
You can avoid the use of withExpectations by overriding setUp and tearDown as described here in the documentation:
setUp and tearDown
This is not the recommended approach, because JUnit calls tearDown even if a test fails, and exceptions in tearDown override exceptions thrown by the test. This will result in the original cause of the failure being masked.
overridedefsetUp() {
resetExpectations
}
overridedeftearDown() {
verifyExpectations
}
deftestSomething {
// Setup expectations// Exercise code under test
}
But as that says, there are issues with it :-(
I'm not sure how I could make use of the @MediumTest etc annotations (which are an Android, not a JUnit3, thing). If you have any suggestions, I'd be delighted to hear them. There's no such thing (AFAIK) as a @Test annotation on Android, is there? That's JUnit4 (which isn't supported on Android). Or am I missing something?
Under JUnit 3, almost all Borachio-enabled tests will take the form:
It would be convenient if Borachio called resetExpectations and verifyExpectations automatically at the start and end of any methods annotated as tests.
The text was updated successfully, but these errors were encountered: