From: Thomas Preymesser Date: 2008-01-24T05:15:38+09:00 Subject: Re: Scripts run using load in "for" loop run out of order ------=_Part_31831_269726.1201119343849 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 23/01/2008, Fa Sidd wrote: > > Hi > I am new to ruby and like it so far. > > I have an existing test harness to plug into and need to run a number of > scripts in a specific order. > I am using load in a "for loop" to run them. Unfortunately the scripts > get run out of order. > > To simplify the question, I have created an array of the scripts I need > to run in the required order. But the output shows that the scripts run > in the following order D-test.rb, A-test.rb, C-test.rb and then > B-test.rb. > > Somehow A gets run before C. in your code, your are not 'running' the test cases with your order you're just loading Testcase declarations. All the collected test classes are 'run' when your loop is finished. The test-classes are running in alphabetical order ("TC_Four", "TC_One", "TC_Three", "TC_Two") And how come > it loops through the puts first and then the load? it doesn't - it does perfectly the puts and then the load-statement but since the load is only loading declarations you will see no output (like in every other class declaration which is included in a ruby program). -Thomas --=20 Thomas Preymesser thopre@gmail.com thomas@thopre.com B=FCro: 030 - 830 353 88 mobil: 0176 - 75 03 03 04 Privat: 030 - 49 78 37 06 http://thopre.wordpress.com/ http://www.thopre.com/ ------=_Part_31831_269726.1201119343849--