T
Trans
Hi, I'm trying to manully run unit test using Test::Unit because I need
to isolate certain requires from others in the
course of the tests. Certain files I'm testing can potentially cause
conflits with others, so I need to run them in isolation. But I still
want to tally the tests/assertions/errors, etc. So I'm wondering if I'm
doing this right. Specifically, is popen("-", "w+") giving me a whole
seperate "require space" to utilize?
Here's my code so far:
def fork_test( testfile )
result = nil
IO.popen("-","w+") do |pipe|
result = pipe.instance_eval do
require 'test/unit'
require 'test/unit/collector'
require 'test/unit/collector/objectspace'
require 'test/unit/ui/testrunnermediator'
load( testfile )
tests = Test::Unit::Collector::ObjectSpace.new.collect
runner = Test::Unit::UI::TestRunnerMediator.new( tests )
runner.run_suite
end
end
p result
result
end
Thanks,
T.
to isolate certain requires from others in the
course of the tests. Certain files I'm testing can potentially cause
conflits with others, so I need to run them in isolation. But I still
want to tally the tests/assertions/errors, etc. So I'm wondering if I'm
doing this right. Specifically, is popen("-", "w+") giving me a whole
seperate "require space" to utilize?
Here's my code so far:
def fork_test( testfile )
result = nil
IO.popen("-","w+") do |pipe|
result = pipe.instance_eval do
require 'test/unit'
require 'test/unit/collector'
require 'test/unit/collector/objectspace'
require 'test/unit/ui/testrunnermediator'
load( testfile )
tests = Test::Unit::Collector::ObjectSpace.new.collect
runner = Test::Unit::UI::TestRunnerMediator.new( tests )
runner.run_suite
end
end
p result
result
end
Thanks,
T.