Skip to content

Commit

Permalink
- F better help messages
Browse files Browse the repository at this point in the history
Co-Authored-By: Jay Bazuzi <jay@bazuzi.com>
  • Loading branch information
isidore and JayBazuzi committed Mar 3, 2025
1 parent 805c273 commit 879c939
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,11 @@ private static void checkConditionsForAttribute(Class<? extends Annotation> attr
{
if (!isDynamicWrapperPresent())
{
throw new FormattedException("When using dynamic tests and Approvals, you need to use %s instead.",
"org.approvaltests.integrations.junit5.JupiterApprovals.dynamicTest(String, Executable)");
String helpMessage = "When using dynamic tests and Approvals, Instead use: \n" +
" org.approvaltests.integrations.junit5.JupiterApprovals.dynamicTest(String, Executable)\n" +
" More at: https://github.com/approvals/ApprovalTests.Java/blob/master/approvaltests/docs/how_to/UseTestFactory.md";

throw new FormattedException(helpMessage);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ Collection<DynamicTest> testFactory2()
}
catch (RuntimeException e)
{
String helpMessage = "When using dynamic tests and Approvals, you need to use org.approvaltests.integrations.junit5.JupiterApprovals.dynamicTest(String, Executable) instead.";
String helpMessage = "When using dynamic tests and Approvals, Instead use: \n" +
" org.approvaltests.integrations.junit5.JupiterApprovals.dynamicTest(String, Executable)\n" +
" More at: https://github.com/approvals/ApprovalTests.Java/blob/master/approvaltests/docs/how_to/UseTestFactory.md";
assertEquals(helpMessage, e.getMessage());
}
}));
Expand Down

0 comments on commit 879c939

Please sign in to comment.