turn-project / turn

Turn provides a set of alternative runners for MiniTest, both colorful and informative.
https://rubygems.org/gems/turn
MIT License
416 stars 70 forks source link

MiniRunner shouldn't set @@out with StringIO.new #96

Closed os97673 closed 12 years ago

os97673 commented 12 years ago

Hi,

MiniRunner sets @@out in ::MiniTest::Unit to StringIO.new. This way the whole MiniTest subsystem can not be reused correctly, namely suppose turns is loaded automatically by Rails' version of test_helper, but user wants to use one of reporters from minitest-reporters and so in its test_helper.rb she has the following code

require 'minitest/reporters'
MiniTest::Unit.runner = MiniTest::SuiteRunner.new
MiniTest::Unit.runner.reporters << MiniTest::Reporters::RubyMateReporter.new

and after that point there is no output :( Perhaps, if you just want to turn all output of minitest when turn's runner is used it would be better to override output method to return instance of StringIO? Will this work for your purposes?

Regards, Oleg.

trans commented 12 years ago

Yes, that's a good point. At the time I didn't give much thought to the fact that it was a class instance variable, not an regular instance variable.

If it can be changed such that the output is still redirected for turn, then I would happily accept a pull request.

os97673 commented 12 years ago

Ok, I will see what could be done :)

os97673 commented 12 years ago

Thank you for accepting the request. When you are going to release a new version of turn so the changes become available?