From: jrb3@... Date: 2003-12-12T01:58:09+09:00 Subject: Re: Ideas for replacing $0==__FILE__ Steve Lumos saith: > $0 == __FILE__ idiom > Do people really consider this idiom to be *that* useful? Most of the > times I've seen it used, it wraps either examples (better done in > separate files, you can have more than one and more complex), or tests > (*much* better done with Test::Unit). I've found it very useful for my own unit-testing using Test::Unit. Now, being a Ruby nuby, I haven't absorbed what might have come before about this, but I set up my unit-testable Ruby library files as executables -- invoke them directly to run the unit tests, and the above idiom guards the test code. Others are welcome to point me to current community thought (and working code :-) on how to do this. This being Ruby not Perl, there should I guess be only One Way To Do This. ;-) Joseph Beckenbach lead XP tester, Eidogen Inc.