From 26d3fe678161c80c4beffdac337c044a561d2acd Mon Sep 17 00:00:00 2001 From: Nick Gauthier Date: Wed, 10 Feb 2010 14:02:19 -0500 Subject: [PATCH] Properly disabling Test::Unit autorun on exit so it won't display extra results --- lib/hydra/runner.rb | 6 +++--- test/test_helper.rb | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/hydra/runner.rb b/lib/hydra/runner.rb index ddacd6e..aa293cd 100644 --- a/lib/hydra/runner.rb +++ b/lib/hydra/runner.rb @@ -1,5 +1,7 @@ require 'test/unit' require 'test/unit/testresult' +Test::Unit.run = true + module Hydra #:nodoc: # Hydra class responsible for running test files. # @@ -15,9 +17,7 @@ module Hydra #:nodoc: # parent) to send it messages on which files to execute. def initialize(opts = {}) @io = opts.fetch(:io) { raise "No IO Object" } - @verbose = opts.fetch(:verbose) { false } - - Test::Unit.run = true + @verbose = opts.fetch(:verbose) { false } $stdout.sync = true trace 'Booted. Sending Request for file' diff --git a/test/test_helper.rb b/test/test_helper.rb index 4fe607a..6f7260c 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -7,6 +7,9 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) $LOAD_PATH.unshift(File.dirname(__FILE__)) require 'hydra' +# Since Hydra turns off testing, we have to turn it back on +Test::Unit.run = false + class Test::Unit::TestCase def target_file File.expand_path(File.join(Dir.tmpdir, 'hydra_test.txt'))