Waiting for exeution to end

I have a snippet of code like this:

class TestSuite < Watir::TestCase
File.open(ARGV[0]||‘testlist.txt’).each_line do |entry|
if entry[0] == “#”
pass
else
code = lambda{load “#{entry.strip}.rb” }
self.send(:define_method, entry.strip, code)#{load
“#{entry.strip}.rb” }#puts “#{entry.strip}”
#self.send(:public, entry.strip.to_sym )
end
end
end

if $0 == FILE
require ‘test/unit/ui/console/testrunner’
Test::Unit::UI::Console::TestRunner.run(TestSuite)
end

which basically is a harness to run a load of tests using WATIR. I’ve
written some reporting tools, using a class called Grapher. What I’d
like to happen, is the test suite runs, then the grapher performs its
task. However, if I place the call to grapher after the line
Test::Unit::UI::Console::TestRunner.run(TestSuite), it executes before
the tests have completed execution.

I’m looking for an elegant solution to this - should I spawn a process
or something?

is there a way to use yield here around the execute line?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs