DEV Community

Discussion on: Is Minitest::Assertions#assert Ever the Best Choice?

Collapse
 
briankephart profile image
Brian Kephart

I actually tend to think the opposite, that the other assertions are just sugared-up assert. Sure, the default message isn't informative, but the others aren't any better IMO. Expected 5 to be <= 4 doesn't tell you anything about what those numbers mean or why they're in your tests. I almost always customize the error message to be informative in the context of my own code. Since I'm doing that anyway, it saves headspace not to try and remember alternative constructions, especially when I can never remember which assertions are from Minitest, which are from Rails, and which have been deprecated/removed.

Collapse
 
burdettelamar profile image
Burdette Lamar

Thanks, Brian. That's interesting.

Collapse
 
burdettelamar profile image
Burdette Lamar

The place where I use Minitest::Assertions is in developing my own libraries. In that work I allow no bug to live more than a day, so all I really need is the expected/actual values and the line number. And the assertions give me those.

For other work (automated testing for legacy software, for example), I use different toolsets altogether.