I've put together a small patch to Test::Unit to fix this problem. It is attached and also included in the Watir 1.5 repo.
require 'watir/testcase'
Simply requiring the patch will not change behavior. To change the way the methods in a single test case are executed use " execute :sequentially"
class TC2_Sequential < Test::Unit::TestCase
execute :sequentially
def test_b; print 'E'; end
def test_a; print 'F'; end
def test_d; print 'G'; end
def test_c; print 'H'; end
end
execute :sequentially
def test_b; print 'E'; end
def test_a; print 'F'; end
def test_d; print 'G'; end
def test_c; print 'H'; end
end
To have all your test cases execute this way
Test::Unit::TestCase.default_order = :sequentially
For your entertainment, you can also specify the following options in either of these contexts
:alphabetically # pre-existing order
:reversed_alphabetically
:reversed_sequentially
:reversed_alphabetically
:reversed_sequentially
Michael, did i get the parts of speech correct here?
The default order governs cases where a test case specific directive is not provided. Note that the test cases themselves are still run alphabetically. One thing at a time.
Bret
testcase.rb
Description: Binary data
_______________________________________________ Wtr-general mailing list [email protected] http://rubyforge.org/mailman/listinfo/wtr-general
