From: Daniel Berger Date: 2009-07-16T22:41:20+09:00 Subject: Re: Test::Unit run order > -----Original Message----- > From: Dylan [mailto:mejari@gmail.com] > Sent: Wednesday, July 15, 2009 11:15 AM > To: ruby-talk ML > Subject: Test::Unit run order > > Hey there! I had a question about the order tests are run in > Test::Unit. I have a class with about 10 tests and I'd like to be able > to better control the order they run in. Right now they just run > alphabetically, and I could just add prefixes to my test names, but > I'm likely not going to be the one updating this code in the future > and I'd like to keep it as straightforward and simple as possible > (i.e. not end up with test_admintests_part1_login as a test name). I'm > keeping them all in one class because I'm using CI_reporter to > generate the XML results and I'd like it to be in one file. Is there > any way to change the order individual tests run, or is there a way to > have CI_reporter create only 1 XML file for multiple test suites. I've > looked around quite a bit for answers to either of these questions but > have so far found nothing (although it's a distinct possibility that I > just totally missed it an need a smack on the head). :) Thank you very > much! I submitted a feature request for Test::Unix 2.x for something along these lines and it was accepted. http://rubyforge.org/tracker/index.php?func=detail&aid=26627&group_id=5650&a tid=21859 In short, Kouhei added the '--order' option which lets you run tests in the order in which the methods are defined within the test suite rather than alphabetically. It hasn't been released yet, but you can grab it from CVS (or wait until it is released, though I'm not sure when that will be). Regards, Dan