From: Nasir Khan Date: 2007-07-07T06:27:25+09:00 Subject: Weird test/unit behavior ------=_Part_100338_4208497.1183757246928 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Consider a simple test - my_test.rb: ---------------------------------------- require 'test/unit' class MyTest < Test::Unit::TestCase def test1 assert(true) end end ---------------------------------------- Now consider a simple script to run this. run2.rb: ---------------------------------------- if ARGV.length == 0 puts "usage run testfile" else type = ARGV.shift if type == "-t" f = ARGV.shift load f end end ---------------------------------------- So if you run it then you get the expected result. run2 -t my_test.rb Loaded suite ~sparkle:/nasir/misc/test/run2 Started . Finished in 0.0 seconds. 1 tests, 1 assertions, 0 failures, 0 errors But now consider another script to run the same test. run1.rb: -------------------------------------------- D:\nasir\misc\test>cat run1.rb if ARGV.length == 0 puts "usage: run testfile" else ARGV.each_with_index do |arg, i| if arg == "-t" load ARGV[i+1] end end end -------------------------------------------- When you run it the testcase is loaded alright but it doesnt run! run1.rb -t my_test.rb Loaded suite ~sparkle:/nasir/misc/test/run1 Started Finished in 0.0 seconds. 0 tests, 0 assertions, 0 failures, 0 errors ------ Apparently the testsuite is not run/loaded in this case. Any help in finding out what is going on is appreciated. - nasir ------=_Part_100338_4208497.1183757246928--