From e3a26c8b2c949badcf1f8b628fa6661d3bf86577 Mon Sep 17 00:00:00 2001 From: Christian Edward Gruber Date: Sat, 29 Jun 2013 19:43:34 -0700 Subject: [PATCH] Fix (irrelevant) error in test, and strengthen it to ensure the right failure is being caught. --- core/src/test/java/dagger/ModuleTest.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/core/src/test/java/dagger/ModuleTest.java b/core/src/test/java/dagger/ModuleTest.java index 56dcecc51e1..ffe818aed55 100644 --- a/core/src/test/java/dagger/ModuleTest.java +++ b/core/src/test/java/dagger/ModuleTest.java @@ -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