RubyFlow : The Ruby Community Blog

Home   Submit   Sign Up   Log In   leaders   Twitter   RSS Feed  

nanotest - When all you need is #assert

Extremely minimal test framework. Perfect for DIY lovers. Nanotest provides the bare minumum needed; for everything else, there's ruby.



this is 22 lines of code. the results aren't even that flexible or sensible. some dots? if you want to add some value, why not a hash or something? so, so, so pointless

oh yeah, and there's

require 'test/unit'kenny - December 08, 2009 18:17
hey let's spend 20 minutes writing a pointless little app, call it "simple" and "minimal" and think we've accomplished somethingkenny - December 08, 2009 18:20
Does not hurt to have one more test framework.
Ruby does not have assert built in. This could potentially be poor man's assert after some modification.gcao - December 08, 2009 19:57
@kenny The results only contain dots and F's because that's all you truly need a test suite to provide. Of course other features are sometimes nice to have, in which case you can either add a simple nanotest extension to provide it, or, as you pointed out, use a more complete test framework like test/unit. Writting a full-featured framework was not the goal of nanotest.

As for simplicity, there are concrete advantages to it. For one, it makes it easy to extend (see test/unit's source for example), and it also allows you to use/require only what you need. Some people appreciate this, though I do understand that others prefer a lib that does a lot and only pick what they need from it.

Btw, minitest was a rewrite of test/unit with code simplicity in mind AFAIK, and it made it into ruby core. I'm pointing this out only to illustrate that there are quite a few coders who enjoy working with simple(r) libs.

Nanotest's code being tiny, I was expecting bikeshed arguments and harsh comments. So I'm ok with it. I thought I should at least justify a few design choices.mynyml - December 08, 2009 20:59
I think this is pretty cool, actually. I love minimalism. Less is more, especially when programming.Chris - December 08, 2009 21:59
@kenny, no need to be rude when criticizingncr - December 10, 2009 16:50
I'll +1 on the idea of being a coder that enjoys working with simple(r) libs. The most powerful notion in nanotest is that it doesn't tell you how to structure your tests.Delano - December 16, 2009 12:47

Post a Comment

Comment abilities for non registered users are currently deactivated, pending time to add a proper CAPTCHA to solve the escalating spam problem. Sorry!