I need something like:
assertThat({throw new Exception("hey!")}).throws(Exception).hasMessage("hey!");
In Java I used a standard approach, but it's too much for a language with closures:
try{
throw new Exception("hey!");
fail("not thrown");
}catch (Exception e){
assertThat(e).hasMessage("hey!");
}
Using frameworks like JUnit, Hamcrest, Fest or Mockito is very welcome.