Gene,

The first time you do "require '1_test.rb'" it will load the first file in 
the load path with this name. The second time you do a "require 
'2_test.rb'" it does nothing -- a file by that name was already loaded.

You could use unique test names to make this scheme work, but I suggest you 
use load instead of require. It doesn't use the load path.

Bret

At 03:30 PM 10/24/2005, Eugene Kula wrote:
>Greetings All,
>
>I setup a file structure to organize tests and am having problems running
>scripts due to the relative path.  Following is an example of my file
>structure:
>
>webtest/
>   testsuite1/
>     testsuite1a/
>       alltest.rb --Queries current directory and runs all tests
>       1_test.rb
>       2_test.rb
>     testsuite1b/
>       alltest.rb
>       1_test.rb
>       2_test.rb
>     alltests.rb --Queries sub directories and runs alltests.rb in subdirs
>
>
>I am finding that testsuite1a/alltests.rb runs fine, but when I go up a
>directory and run testsuite1/alltests.rb the alltests.rb in the sub dirs
>don't run.  Following are my alltests scripts:
>
>#parent alltests.rb
>$LOAD_PATH << File.join(File.dirname(__FILE__), '..') #load parent dir
>$LOAD_PATH << File.dirname(__FILE__) #load current path
>
>allDir = Dir["*TestSuite*/alltests.rb"]
>
>allDir.each{|z| require z}
>
>
>
>#child alltests.rb
>$LOAD_PATH << File.join(File.dirname(__FILE__), '..')
>$LOAD_PATH << File.dirname(__FILE__)
>
>allDir = Dir["*_test.rb*"]
>
>allDir.each{|z| require z}
>
>Thanks in advance,
>Gene


_____________________
  Bret Pettichord
  www.pettichord.com

_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to