[MacRuby-devel] MiniTest and TestUnit implementations

Mark Rada mrada at marketcircle.com
Wed May 4 07:14:18 PDT 2011


Hi,

Minitest doesn't have a really clean way of doing what you want, but it does have a simple way. If you look at minitest/pride:

	https://github.com/seattlerb/minitest/blob/master/lib/minitest/pride.rb

It implements an alternative output format for minitest that you could copy and then change so it counts the number of tests.

Test::Unit in Ruby 1.9 is just a compatibility layer to minitest, so they are really the same thing for what you are asking about.

FWIW, rspec has proper custom formatters that support exactly what you have asked about.

HTH,

Mark Rada
mrada at marketcircle.com



On 2011-05-04, at 8:08 AM, anoiaque wrote:

> Hi,
> 
> Why both minitest and testunit modules are so tied to output in the code ...
> Why is there no class/instance method with which i can get result as an object (~ Minitest::Unit.run(<test_file, or class test file ..>) => <TestResult @errors = ... @failures= ...>)
> 
> Why must i hack theses modules(even if its quite easy with ruby) to get result as an object i can work with , that is get (with Testunit) :
> <Test::Unit::TestResult:0x10109a1a8 @assertion_count=13, @errors=[], @run_count=9, @channels={"CHANGED"=>{}, "FAULT"=>{}}, @failures=[]>
> 
> Can you imagine , like it's done in ZenTest i gonna parse output with regexp to get it ... :(
> :(
> 
> I've digged the source code (both minitest and testunit), but if i'm wrong and this way exists without hacking, tell me it ..
> 
> Thanks.
> 
> 
> 
> anoiaque at gmail.com
> 
> 
> 
> 
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20110504/466cbd9a/attachment.html>


More information about the MacRuby-devel mailing list