Forum: Ruby-core [Feature #3380] Minitest Runner Command

Posted by Thomas Sawyer (Guest)
on 2010-06-02 16:37
(Received via mailing list)
Feature #3380: Minitest Runner Command
http://redmine.ruby-lang.org/issues/show/3380

Author: Thomas Sawyer
Status: Open, Priority: Normal
Category: lib

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.
Posted by Ryan Davis (Guest)
on 2010-07-15 21:55
(Received via mailing list)
Issue #3380 has been updated by Ryan Davis.

Status changed from Open to Rejected
Priority changed from Normal to Low

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.

----------------------------------------
http://redmine.ruby-lang.org/issues/show/3380
Posted by Thomas Sawyer (Guest)
on 2010-08-30 19:54
(Received via mailing list)
Issue #3380 has been updated by Thomas Sawyer.


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.

----------------------------------------
http://redmine.ruby-lang.org/issues/show/3380
Posted by Ryan Davis (Guest)
on 2010-08-31 21:11
(Received via mailing list)
Issue #3380 has been updated by Ryan Davis.


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).

----------------------------------------
http://redmine.ruby-lang.org/issues/show/3380
Posted by Roger Pack (Guest)
on 2010-09-07 16:02
(Received via mailing list)
> 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.

I think he's referring to the fact that with test/unit, you didn't
need to include 'minitest/autorun' (for examples, rspec 1.3 does
something like what you describe, but rspec 2 does not--it provides a
runner).
Thus, the functionality breaks from 1.8 to 1.9.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.