aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-10-24 06:16:36 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-10-24 06:16:36 +0000
commit5383964f98659ea0cd371d77b9ed97f46702e591 (patch)
treedee934a25ec3ef2e858eaff78679f1b4d770b990 /lib
parentb560b080145a477d5d8a00d7e403248b1609cfa1 (diff)
downloadruby-5383964f98659ea0cd371d77b9ed97f46702e591.tar.gz
* lib/test/unit.rb (Test::Unit::Mini#run): abort if interrupted.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29581 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/test/unit.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/test/unit.rb b/lib/test/unit.rb
index f7e7246198..87c9d1b022 100644
--- a/lib/test/unit.rb
+++ b/lib/test/unit.rb
@@ -162,10 +162,18 @@ module Test
@@installed_at_exit = true
end
+ def run(*args)
+ result = super
+ abort if @interrupt
+ result
+ end
+
def run_test_suites(*args)
old_sync = @@out.sync if @@out.respond_to?(:sync=)
+ @interrupt = false
super
rescue Interrupt
+ @interrupt = true
[@test_count, @assertion_count]
ensure
@@out.sync = old_sync if @@out.respond_to?(:sync=)