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
[email protected]



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.
> 
> 
> 
> [email protected]
> 
> 
> 
> 
> _______________________________________________
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

_______________________________________________
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

Reply via email to