Minitest Runner Command
MiniTest needs a commandline tool for running tests, just as TestUnit had with testrb. It would be nice if we could just have testrb back, but that must be weighed against the fact the TestUnit 2.0+ still uses it.
In any case, having a commandline tool makes it easy to run the tests without having to fuss with "automagically" test running via MiniTest::Unit.autorun. It also opens up the potential for more running options such as -Ilib and -rfoo.rb, etc. The class that implements the command could also be constructed in such a way the it could be used via code as well --which would be useful for a Rake task, for instance.
#2 Updated by Ryan Davis over 6 years ago
- Status changed from Open to Rejected
- Priority changed from Normal to 3
minitest has a commandline tool for running tests. It is called rake. There is already a rake task for running tests that ships with ruby 1.9.x.
I have no idea what you're referring to with your "automagic" comment. There is no magic involved. Your tests should be requiring 'minitest/autorun' and the rest is, as the name implies, automatic. It doesn't matter if you're running a single file or a whole suite, it just works.
#3 Updated by Thomas Sawyer over 6 years ago
Not everyone uses rake.
By "automagic" I am simply referring to the at_exit procedure that must be used to run tests. While a runner that did not need this would be nice, it's not the main reason I suggest a commandline tool. Sometimes one needs to change-up the load path or what is required when debugging and running tests. A commandline tool would be useful for that, where as now one must edit files.
In any case, I did a little sniffing about minitest and see how to tap into the command-line interface myself, now. So at least I should be able to use that when I am not using the rake task. That's the more important use case for me.
#4 Updated by Ryan Davis over 6 years ago
Not everyone uses rake... sure. Everyone uses ruby. Changing up the load path is handled by ruby -I. You know this and you know that I know you know this. So I still do not see the use case. I have been using minitest for years now and have yet to need a commandline wrapper around it. I see this as a definite win over crippled tools like rspec and cucumber... so you're going to have a very hard time convincing me otherwise.
ruby -Ilib test/test_thingy.rb
works great for me (tho I usually do that via autotest if I'm doing any serious development).