[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

How to control order of spec execution in "spec specs/* " ?

Andrew Chen

3/20/2008 5:01:00 PM

This is a rspec question.

I have many rspecs in a spec directory.

In the execution, I need some tests run before others. So I name the
files as: 01_deploy_spec.rb, 02_post_process_spec.rb

I want 01* to be run before 02*

I found that the default order in rspec is in the order of last file
modification.

What are the ways to do it?

Thanks
~Andrew Chen

1 Answer

David Chelimsky

3/25/2008 12:36:00 PM

0

On Thu, Mar 20, 2008 at 12:01 PM, Andrew Chen <hangfei@gmail.com> wrote:
> This is a rspec question.
>
> I have many rspecs in a spec directory.
>
> In the execution, I need some tests run before others. So I name the
> files as: 01_deploy_spec.rb, 02_post_process_spec.rb
>
> I want 01* to be run before 02*
>
> I found that the default order in rspec is in the order of last file
> modification.

The default is actually alpha. mtime must be invoked explicitly. Do
you have mtime listed in spec/spec.opts? If so, get rid of it and you
should be OK.

Cheers,
David

>
> What are the ways to do it?
>
> Thanks
> ~Andrew Chen
>
>