concept inline unit test in category groovy

appears as: inline unit tests
Groovy in Action, Second Edition

This is an excerpt from Manning's book Groovy in Action, Second Edition.

This book contains several hundred assertion statements—and indeed, you’ve already seen a number of them. Now it’s time to go into extra detail. We’ll look at producing meaningful error messages from failed assertions, reflect over reasonable uses of this keyword, and show how to use it for inline unit tests. We’ll also quickly compare the Groovy solution to Java’s assert keyword and assertions as used in unit test cases.

Listing 6.7. Using assertions for inline unit tests