Module: ActiveSupport::Testing::Isolation::TestUnit

Defined in:
activesupport/lib/active_support/testing/isolation.rb

Instance Method Summary collapse

Instance Method Details

#run(result) {|Test::Unit::TestCase::STARTED, name| ... } ⇒ Object

Yields:

  • (Test::Unit::TestCase::STARTED, name)


56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'activesupport/lib/active_support/testing/isolation.rb', line 56

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)

  yield(Test::Unit::TestCase::FINISHED, name)
  retval
end