Feature Requests: Browse | Submit New | Admin

[#27937] Individual test prerequisites

Date:
2010-03-05 23:13
Priority:
3
Submitted By:
Daniel Berger (djberg96)
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
Individual test prerequisites

Detailed description
Hi,

I realize it's somewhat taboo, but sometimes you have a test that must run before another test. In practice, this has
been accomplished by adding "01", "02", etc, to the test names.

What if we use an idea from Rake, where we could specify prerequisites for individual tests. Here's an idea:

def test_alpha(:before => :test_beta)
  # alpha tests should run before test_beta
end

def test_beta(:after => :test_alpha)
  # don't run these tests until after test_alpha has run
end

Does that look reasonable?

Regards,

Dan

Add A Comment: Notepad

Please login


Followup

Message
Date: 2010-03-06 00:14
Sender: Kouhei Sutou

What about the following?

def test_story
  sub_test_alpha
  sub_test_beta
end

def sub_test_alpha
end

def sub_test_beta
end

It seems intuitive.
Date: 2010-03-05 23:54
Sender: Erik Hollensbe

How would that work? Those are argument lists for the definition,
not the call.

Alternatively, maybe something like:

def test_alpha
  run_before :beta
end

def test_beta
  run_after :alpha
end

Might work, or class method style:

before :alpha, :beta
after  :beta, :alpha

def test_alpha ....

I like Dan's way the best, but I'm not entirely sure it's possible,
is all I'm saying.

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item