Solution for Groovy 2.x (I guess ,it works on all version of Groovy.I just didn't test it.
I started from catch assert with Exception,but ...as usual ... it was a bad ideas as,when I run this code:
then ,I was welcome with error:
Nov 07, 2013 10:04:05 AM org.codehaus.groovy.runtime.StackTraceUtils sanitize
WARNING: Sanitizing stacktrace:
Quick look to Groovy docs and I found that I should use AssertionError instead:
Due dynamic nature of Groovy it is good to check Exceptions chapter on Groovy:
as they handle things differently.
(Groovy 2.x has amazing multi catch option!