I very new to Ruby (this is my second week), so excuse the "newbieness" 
of my question.

I downloaded a project from RubyForge and I'm playing around with the 
scripts.  I'm having trouble getting the tests to pass - some pass if 
run from the main directory, others I have to be in the main/test 
directory for them to work.  When the tests fail, it's because a 
"require" statement failed - usually for a file that was already 
encountered in a require statement in another file.  Changing the 
"require" to a "load" statement fixes the problem - in some situations.

My solution (remember, I'm a Ruby-Newbie so don't laugh) was to try 
changing the require statements to something like:

load File.dirname(__FILE__) + "/filename.rb" unless
  require File.dirname(__FILE__) + 'filename'

With this, I'm able to run the test from any directory (even from "/"). 
So, this seems like a really good solution.  I only use "load" if 
"require" fails and I ensure that Ruby can always find the files it 
needs.

My question is whether using this "load unless require" approach will 
lead to other problems?  Would making this change result in some bad 
mojo somewhere down the line?

-- 
Posted via http://www.ruby-forum.com/.