Dashboard > Watir > ... > Contributions > Test-Unit Patch
Watir Log In View a printable version of the current page.
Test-Unit Patch
Added by Bret Pettichord, last edited by Bret Pettichord on Jun 21, 2008  (view change)
Labels: 
(None)

This code, originally provided as a patch, is now bundled with Watir 1.5.

Technically, it is not a patch for Watir, but rather for Test::Unit.

Run your test methods in the order you've defined them

Ruby's test-unit library executes test methods in alphabetical order. This test case subclass executes them in the order you define them instead.

Download Patch

To change the way the methods in a test case are executed use execute :sequentially:

require 'watir/testcase'

class TC2_Sequential < Watir::TestCase
  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
  Name Size Creator Date Comment  
File testcase.rb 2 kb Bret Pettichord Jun 06, 2006 revision 1016  

Site running on a free Atlassian Confluence Community License granted to OpenQA. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.6 Build:#812 Aug 06, 2007) - Bug/feature request - Contact Administrators