[Nitro] test stuff

Steven Lumos steven at lumos.us
Fri Aug 5 20:57:45 EDT 2005

TRANS <transfire at gmail.com> writes:

> I'm inclined to do the same for Facets. I don't see why it should be a
> problem. On the other hand I've cautiously moving toward including
> tests in with the code itself, i.e.
>   # code
>   ...
>   require 'test/unit' if $0= __FILE__
>   # test
>   ...
> This may not be a viable solution for a web-engine like nitro, but it
> seems to work find for extensions. Any comments/caveats to this
> approach?
> T.
> P.S. Perhaps I should foward this discussion to ruby-talk?

I think I've mentioned this on ruby-talk before, but my group likes to
combine code and dependencies into a single file.  Aside from greatly
simplifying delivery, we've seen surprisingly large runtime benefits.

The $0 == __FILE__ convention makes writing a program to do the
bundling a lot more complicated.

Of course, it's already popular enough that I wouldn't blame you for
ignoring our situation.  :-)


P.S. There was a thread about adding a TEST{} block like BEGIN{} and
END{}, if you can find that you'll get a good overview.

More information about the Nitro-general mailing list