🕷 zenspider.com

by ryan davis

Looking for the Ruby Quickref?

one more thing

Published 2008-04-28 @ 11:01

Tagged ruby, thoughts

While I’m on the topic…

assert_nothing_raised and assert_nothing_thrown are the two most useless assertions on the planet. If they have spec equivalents, add those to the list as well.

I had a student litter those everywhere and I told him not to use it. He said he was just trying to be “explicit”. You’re writing a test already, you’re already being explicit. By virtue of running code in the first place you’re asserting that it doesn’t throw anything unexpected.

Why does anyone use it? Is it just to up the assertion count?

I think I’m going to deprecate them from the assertion library unless someone can show me a compelling reason not to.