Search in sources :

Example 1 with TestEnvironmentSpec

use of org.robolectric.internal.AndroidSandbox.TestEnvironmentSpec in project robolectric by robolectric.

the class RobolectricTestRunnerTest method failureInResetterDoesntBreakAllTests.

@Test
public void failureInResetterDoesntBreakAllTests() throws Exception {
    RobolectricTestRunner runner = new SingleSdkRobolectricTestRunner(TestWithTwoMethods.class, SingleSdkRobolectricTestRunner.defaultInjector().bind(TestEnvironmentSpec.class, new TestEnvironmentSpec(AndroidTestEnvironmentWithFailingSetUp.class)).build());
    runner.run(notifier);
    assertThat(events).containsExactly("started: first", "failure: fake error in setUpApplicationState", "finished: first", "started: second", "failure: fake error in setUpApplicationState", "finished: second").inOrder();
}
Also used : TestEnvironmentSpec(org.robolectric.internal.AndroidSandbox.TestEnvironmentSpec) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 TestEnvironmentSpec (org.robolectric.internal.AndroidSandbox.TestEnvironmentSpec)1