benjamin84 / fest

Automatically exported from code.google.com/p/fest
0 stars 0 forks source link

Add support for checking exceptions #115

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
From Ted Young:

Since we often want to check not just the Exception, but also the message,
option number 3 would be the closest to the way we do it in our code.
However, we often can't compare the message precisely, so I was thinking of
something like:

assertThat(new CodeToTest() { public void run() {
// code to test
}).throws(SomeException.class).message().contains("Oops");

Where message() returns a StringAssert.

Original issue reported on code.google.com by Alex.Rui...@gmail.com on 20 Feb 2008 at 9:34

GoogleCodeExporter commented 9 years ago
Set the module as a label, instead of being part of the title.

Original comment by Alex.Rui...@gmail.com on 1 Dec 2008 at 1:52

GoogleCodeExporter commented 9 years ago
We'll address this issue in version 1.1

Original comment by Alex.Rui...@gmail.com on 10 Dec 2008 at 1:55

GoogleCodeExporter commented 9 years ago
We won't address this issue due to loss of the original context of the fluent
interface. More details at
http://www.jroller.com/alexRuiz/entry/abusing_method_chaining_in_fluent

Original comment by Alex.Rui...@gmail.com on 21 Jan 2009 at 6:20

GoogleCodeExporter commented 9 years ago
I agree. Though should there be another issue to track the alternatives 
suggested, 
e.g.:

assertThat(exception).hasNoCause() 
.hasMessage(thatContains("purpose"));

Original comment by tedyo...@gmail.com on 21 Jan 2009 at 6:34

GoogleCodeExporter commented 9 years ago
Ted, I completely agree. Probably we should keep this issue open, with the
alternatives as the new target.

Original comment by Alex.Rui...@gmail.com on 21 Jan 2009 at 6:25

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Issue migrated to http://kenai.com/jira/browse/FEST-52

Original comment by Alex.Rui...@gmail.com on 16 Feb 2009 at 12:13

GoogleCodeExporter commented 9 years ago
Issue migrated to http://jira.codehaus.org/browse/FEST-62

Original comment by Alex.Rui...@gmail.com on 5 Mar 2009 at 10:31