I'm not sure it will solve your problems, but I played around with Test::Unit::Reporter a while back and had to add "require 'stringio'" in reporter.rb to get it to work.
To give appropriate credit, it was actually pointed out by another member of this list: http://www.mail-archive.com/[email protected]/msg02046.html -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chris McMahon Sent: Monday, January 30, 2006 4:38 PM To: [email protected] Subject: [Wtr-general] Anyone use Test::Unit::Reporter? Fwd: Help withFile.join(File.dirname(__FILE__), '..') ? Hi again... I'm trying to integrate Test::Unit::Reporter with my little harness script below, and struggling. Ideally, I would pass each "test_cases" array to Reporter and it would Do The Right Thing, but that's not happening. ############################## #ORIGINAL WORKING SCRIPT TOPDIR = File.join(File.dirname(__FILE__), '..') $LOAD_PATH.unshift TOPDIR require 'test/unit' require 'fileutils' include FileUtils::Verbose test_dirs = Dir.glob("suite**") 0.upto(test_dirs.length - 1) do |dirnum| chdir(test_dirs[dirnum]) puts "" puts "working in #{test_dirs[dirnum]}" test_cases = Dir.glob("*rb") test_cases.each do |casex| puts "running #{casex}" test_result = `ruby #{casex}` puts test_result end chdir("..") end #do ######################################### # WHAT I WISH WOULD HAPPEN TOPDIR = File.join(File.dirname(__FILE__), '..') $LOAD_PATH.unshift TOPDIR require 'test/unit' require 'fileutils' include FileUtils::Verbose require 'test/unit/testsuite' require 'test/unit/ui/reporter/reporter' @test_cases = Test::Unit::TestSuite.new FileUtils.mkdir_p 'build/report' test_dirs = Dir.glob("suite*") 0.upto(test_dirs.length - 1) do |dirnum| chdir(test_dirs[dirnum]) puts "" puts "working in #{test_dirs[dirnum]}" @test_cases = Dir.glob("*rb") Test::Unit::UI::Reporter::Reporter.run(@test_cases, 'build/report', :xml) chdir("..") end #do _______________________________________________ Wtr-general mailing list [email protected] http://rubyforge.org/mailman/listinfo/wtr-general _______________________________________________ Wtr-general mailing list [email protected] http://rubyforge.org/mailman/listinfo/wtr-general
