Testcase order

I'm trying to run different testcases in a file:
require 'testcases/dopTest'
require 'testcases/bipTest'
require 'testcases/canTest'

But when I run it the order is not as I wrote it. First it's run bipTest
and the last one dopTest.

How can I sort the order I want?

Thanks.

···

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

Name them in alphabetical order.

···

On Wed, Apr 9, 2008 at 10:18 AM, Mario Ruiz <mario@betware.com> wrote:

I'm trying to run different testcases in a file:
require 'testcases/dopTest'
require 'testcases/bipTest'
require 'testcases/canTest'

But when I run it the order is not as I wrote it. First it's run bipTest
and the last one dopTest.

How can I sort the order I want?

So it's impossible to run the testcases in the 'require' order

···

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

Each of your test should be independent from the other tests.
Why do you want to run them in a specific order?

-Thomas

···

On 09/04/2008, Mario Ruiz <mario@betware.com> wrote:

So it's impossible to run the testcases in the 'require' order

Because I'm running testcases that need the result of another one so
must be run first.

···

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

Don't do that. You don't want your testcases coupled to each other. really. Refactor your tests and decouple them from each other and you'll be much much happier in the long run.

···

On Apr 9, 2008, at 09:04 , Mario Ruiz wrote:

Because I'm running testcases that need the result of another one so
must be run first.

Because I'm running testcases that need the result of another one so must be run first.

Testcases should run in issolation. One testcase should not be dependent on another.