Skip to content

Commit

Permalink
Fix (irrelevant) error in test, and strengthen it to ensure the right…
Browse files Browse the repository at this point in the history
… failure is being caught.
  • Loading branch information
cgruber committed Jun 30, 2013
1 parent 2fa92e6 commit e3a26c8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions core/src/test/java/dagger/ModuleTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,14 @@ static class ModuleMissingModuleAnnotation {}
@Module(includes = ModuleMissingModuleAnnotation.class)
static class ChildModuleMissingModuleAnnotation {}

@Test(expected = IllegalArgumentException.class)
@Test
public void childModuleMissingModuleAnnotation() {
ObjectGraph.createWith(new TestingLoader(), new TestingLoader(), new ChildModuleMissingModuleAnnotation());
try {
ObjectGraph.createWith(new TestingLoader(), new ChildModuleMissingModuleAnnotation());
} catch (IllegalArgumentException e) {
assertThat(e.getMessage())
.contains("No @Module on dagger.ModuleTest$ModuleMissingModuleAnnotation");
}
}

@Module
Expand Down

0 comments on commit e3a26c8

Please sign in to comment.