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

A

Andrew Chen

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
 
D

David Chelimsky

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,262
Messages
2,571,056
Members
48,769
Latest member
Clifft

Latest Threads

Top