I have a bunch of test cases in separate .rb files. For this example, a.rb and
b.rb.
I then created an rb file to run all of them, called suite_my_tests.rb
In this file I have:
require 'includes'
require 'a'
require 'b'
class TS_MyTests
def setup
#CBrowser.openMyBrowser()
end
def teardown
#CBrowser.closeMyBrowser()
Test::Unit::UI::Reporter.run(TS_MyTests.suite, 'C:/Program
Files/Watir/examples/test_cases/report',:html)
end
def self.suite
#Test::Unit::UI::Console::TestRunner.new(suite).start
suite = Test::Unit::TestSuite.new("All tests")
suite << TC_a.suite
suite << TC_b.suite
#Test::Unit::UI::Console::TestRunner.new(suite).start
FileUtils.mkdir_p 'C:/Program
Files/Watir/examples/test_cases/report'
#Test::Unit::UI::Reporter.run(TS_MyTests.suite, 'C:/Program
Files/Watir/examples/test_cases/report',:html)
return suite
end
end
I have two questions:
The only time this line seems to
run:Test::Unit::UI::Reporter.run(TS_MyTests.suite, 'C:/Program
Files/Watir/examples/test_cases/report',:html)
is when it is between a begin and end outside of the main class in the file
above - it won't run in the #teardown or in the def self.suite. Am I missing
something?
Also, I have the following line commented out:
#Test::Unit::UI::Console::TestRunner.new(suite).start
Any reason why I would need it uncommented?
Thanks,
Steve
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6414&messageID=18139#18139
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general