diff options
Diffstat (limited to 'activesupport/lib/active_support/testing/isolation.rb')
-rw-r--r-- | activesupport/lib/active_support/testing/isolation.rb | 58 |
1 files changed, 7 insertions, 51 deletions
diff --git a/activesupport/lib/active_support/testing/isolation.rb b/activesupport/lib/active_support/testing/isolation.rb index 6b29ba4c10..1a0681e850 100644 --- a/activesupport/lib/active_support/testing/isolation.rb +++ b/activesupport/lib/active_support/testing/isolation.rb @@ -37,14 +37,6 @@ module ActiveSupport !ENV["NO_FORK"] && ((RbConfig::CONFIG['host_os'] !~ /mswin|mingw/) && (RUBY_PLATFORM !~ /java/)) end - def self.included(base) - if defined?(::MiniTest) && base < ::MiniTest::Unit::TestCase - base.send :include, MiniTest - elsif defined?(Test::Unit) - base.send :include, TestUnit - end - end - def _run_class_setup # class setup method should only happen in parent unless defined?(@@ran_class_setup) || ENV['ISOLATION_TEST'] self.class.setup if self.class.respond_to?(:setup) @@ -52,42 +44,16 @@ module ActiveSupport end end - module TestUnit - def run(result) - _run_class_setup - - yield(Test::Unit::TestCase::STARTED, name) - - @_result = result - - serialized = run_in_isolation do |proxy| - begin - super(proxy) { } - rescue Exception => e - proxy.add_error(Test::Unit::Error.new(name, e)) - end - end - - retval, proxy = Marshal.load(serialized) - proxy.__replay__(@_result) + def run(runner) + _run_class_setup - yield(Test::Unit::TestCase::FINISHED, name) - retval + serialized = run_in_isolation do |isolated_runner| + super(isolated_runner) end - end - - module MiniTest - def run(runner) - _run_class_setup - serialized = run_in_isolation do |isolated_runner| - super(isolated_runner) - end - - retval, proxy = Marshal.load(serialized) - proxy.__replay__(runner) - retval - end + retval, proxy = Marshal.load(serialized) + proxy.__replay__(runner) + retval end module Forking @@ -145,13 +111,3 @@ module ActiveSupport end end end - -# Only in subprocess for windows / jruby. -if ENV['ISOLATION_TEST'] - require "test/unit/collector/objectspace" - class Test::Unit::Collector::ObjectSpace - def include?(test) - super && test.method_name == ENV['ISOLATION_TEST'] - end - end -end |