diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-10-24 06:16:36 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-10-24 06:16:36 +0000 |
commit | 5383964f98659ea0cd371d77b9ed97f46702e591 (patch) | |
tree | dee934a25ec3ef2e858eaff78679f1b4d770b990 | |
parent | b560b080145a477d5d8a00d7e403248b1609cfa1 (diff) | |
download | ruby-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
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | lib/test/unit.rb | 8 |
2 files changed, 11 insertions, 1 deletions
@@ -1,4 +1,6 @@ -Sun Oct 24 14:17:58 2010 Nobuyoshi Nakada <nobu@ruby-lang.org> +Sun Oct 24 15:16:30 2010 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * lib/test/unit.rb (Test::Unit::Mini#run): abort if interrupted. * lib/test/unit.rb (Test::Unit::Mini#run_test_suites): show the result even when interrupted on the way. 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=) |