How do I stop Minitest?
In Ruby 1.9.1, I find that ctrl + c only kills a single unit test, and you can't stop the running of the entire testing program that way.
By contrast, under test/unit in Ruby 1.8, it stops all the tests.
Sample progress bar under 1.9.1:
ruby1.9.1 test/ts_foo.rb
Loaded suite test/ts_foo
Started
..............................^CF..............................................................................^CE..................^C^C^CE..E..^C^C^C^CEE^CE^CE^CE^CE^C^C^CEE^CE^CE^CE^CE^CE^CE..^CE...^C..E..^C.E......^CE..^CE.......^C^C^C开发者_运维知识库E.E.^CE^CE^C^CE^CE..^C.E...^CE.^CE..^CE...^C.E..^C.E..^C.E..^CE...^CE....^CE..............
And under 1.8.7:
$ ruby test/ts_foo.rb
Loaded suite test/ts_foo
Started
........................................................^C.
I'm running this on Ubuntu Karmic Koala, and the Ruby versions are
$ ruby1.9.1 --version
ruby 1.9.1p243 (2009-07-16 revision 24175) [x86_64-linux]
$ ruby --version
ruby 1.8.7 (2009-06-12 patchlevel 174) [x86_64-linux]
It appears that ruby-1.9.1 includes a very ancient version of minitest. This (unusual) behavior has been fixed quite a while ago: minitest commit.
The solution might be either to switch to later 1.9 version (ruby-1.9.2's minitest does include that fix) or to upgrade local ruby-1.9.1 minitest (either manually or hopefully just by installing latest minitest gem).
精彩评论