I figured this out...after a colleague pointed me at Andy Sipe's blog:

http://zbarzone.blogspot.com/2006/04/getting-xml-test-results-from-rails
_06.html

the relevant code I needed to add:

require 'test/unit/collector/objectspace'

#replace class def for the suite with one line
suite = Test::Unit::Collector::ObjectSpace.new().collect()

#generate the output
Test::Unit::UI::Reporter.run(suite, 'C:/TestOutput/Sample')
 
Thanks to Andy!

-Dara

-----Original Message-----
From: Lillis, Dara 
Sent: Monday, November 13, 2006 2:01 PM
To: 'wtr-general@rubyforge.org'
Subject: RE: [Wtr-general] Grouping Test Cases

[resurrecting an old thread]

the code Chris supplies below is useful in that I can use it to run all
tests in a given directory.

I've been struggling with how to package these tests into suites so I
can produce output with Test::Unit::Reporter

That is, I want to replace code like this with something more general:

require 'test/unit/ui/console/testrunner'
require 'test/unit/ui/reporter'

require 'TC_TestCase'

class TS_Suite
  def self.suite
    suite = Test::Unit::TestSuite.new('A Test Suite')
      suite << TC_TestCase.suite
    return suite
  end
end

Test::Unit::UI::Reporter.run(TS_Suite, 'C:/TestOutput/Sample')

Any ideas?


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Chris McMahon
Sent: Wednesday, May 24, 2006 12:51 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Grouping Test Cases

On 5/24/06, Adrian Rutter <[EMAIL PROTECTED]> wrote:
>
> Could anyone tell me how they are grouping test cases and running 
> suites within Watir?
>

#run_suite.rb
topdir = File.join(File.dirname(__FILE__)) Dir.chdir topdir do
  tests = Dir["test*"]
  tests.each{|x| require x}
end

_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to