The tests weren't migrated from junit 3, although I spent many years working 
with it.  Frankly, until I saw your patch today I was unaware of directly using 
Hamcrest. Since junit uses it I really have no problem if we do if it makes the 
tests more readable.

Ralph

> On Jan 5, 2014, at 12:38 AM, Matt Sicker <[email protected]> wrote:
> 
> Hi all, newcomer here. I'm wondering what your opinions are on using Hamcrest 
> matchers in unit tests. That is, using the assertThat() methods and the 
> matchers that go with it. It makes many otherwise hard to read assertions far 
> more literate, plus it provides some nice error messages explaining why an 
> assertion failed (unlike the native assert keyword and certain related 
> methods in org.junit.Assert).
> 
> I don't know if the tests were migrated from JUnit 3 or anything, but I do 
> believe it's the preferred way of asserting things in JUnit.
> 
> And before anyone says something like "patches welcome", I'd be glad to help 
> update unit tests for such a thing. :)
> 
> -- 
> Matt Sicker <[email protected]>

Reply via email to