Properly disabling Test::Unit autorun on exit so it won't display extra results

This commit is contained in:
Nick Gauthier 2010-02-10 14:02:19 -05:00
parent df1afee41b
commit 26d3fe6781
2 changed files with 6 additions and 3 deletions

View File

@ -1,5 +1,7 @@
require 'test/unit' require 'test/unit'
require 'test/unit/testresult' require 'test/unit/testresult'
Test::Unit.run = true
module Hydra #:nodoc: module Hydra #:nodoc:
# Hydra class responsible for running test files. # Hydra class responsible for running test files.
# #
@ -15,9 +17,7 @@ module Hydra #:nodoc:
# parent) to send it messages on which files to execute. # parent) to send it messages on which files to execute.
def initialize(opts = {}) def initialize(opts = {})
@io = opts.fetch(:io) { raise "No IO Object" } @io = opts.fetch(:io) { raise "No IO Object" }
@verbose = opts.fetch(:verbose) { false } @verbose = opts.fetch(:verbose) { false }
Test::Unit.run = true
$stdout.sync = true $stdout.sync = true
trace 'Booted. Sending Request for file' trace 'Booted. Sending Request for file'

View File

@ -7,6 +7,9 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__)) $LOAD_PATH.unshift(File.dirname(__FILE__))
require 'hydra' require 'hydra'
# Since Hydra turns off testing, we have to turn it back on
Test::Unit.run = false
class Test::Unit::TestCase class Test::Unit::TestCase
def target_file def target_file
File.expand_path(File.join(Dir.tmpdir, 'hydra_test.txt')) File.expand_path(File.join(Dir.tmpdir, 'hydra_test.txt'))