Permalink
Browse files

Avoid dependency on MiniTest::Unit::TestCase::PASSTHROUGH_EXCEPTIONS.

  • Loading branch information...
1 parent b057fab commit 7d8e5fac758bebc7199b514b08d4755a6f897435 @floehopper floehopper committed May 29, 2012
Showing with 10 additions and 2 deletions.
  1. +10 −2 activesupport/lib/active_support/testing/setup_and_teardown.rb
View
12 activesupport/lib/active_support/testing/setup_and_teardown.rb
@@ -4,6 +4,14 @@
module ActiveSupport
module Testing
module SetupAndTeardown
+
+ PASSTHROUGH_EXCEPTIONS = [
+ NoMemoryError,
+ SignalException,
+ Interrupt,
+ SystemExit
+ ]
+
extend ActiveSupport::Concern
included do
@@ -28,14 +36,14 @@ def run(runner)
run_callbacks :setup do
result = super
end
- rescue *::MiniTest::Unit::TestCase::PASSTHROUGH_EXCEPTIONS
+ rescue *PASSTHROUGH_EXCEPTIONS
raise
rescue Exception => e
result = runner.puke(self.class, method_name, e)
ensure
begin
run_callbacks :teardown
- rescue *::MiniTest::Unit::TestCase::PASSTHROUGH_EXCEPTIONS
+ rescue *PASSTHROUGH_EXCEPTIONS
raise
rescue Exception => e
result = runner.puke(self.class, method_name, e)

0 comments on commit 7d8e5fa

Please sign in to comment.