Sha256: c9e8a0a5ea08af95f930e4b767720dc844daaa90395c3f3ddd93a4794125c34f
Contents?: true
Size: 1.3 KB
Versions: 17
Compression:
Stored size: 1.3 KB
Contents
require_relative "../../test_helper" require "stringio" module MiniTestReportersTest class ReportersTest < TestCase def test_chooses_the_rubymine_reporter_when_necessary # Rubymine reporter complains when RubyMine libs are not available, so # stub its #puts method out. original_output = MiniTest::Unit.runner.output MiniTest::Unit.runner.send(:define_singleton_method, :output) { StringIO.new } reporters = Minitest::Reporters.choose_reporters [], { "RM_INFO" => "x" } assert_instance_of MiniTest::Reporters::RubyMineReporter, reporters[0] reporters = Minitest::Reporters.choose_reporters [], { "TEAMCITY_VERSION" => "x" } assert_instance_of MiniTest::Reporters::RubyMineReporter, reporters[0] ensure MiniTest::Unit.runner.send(:define_singleton_method, :output) { original_output } end def test_chooses_the_textmate_reporter_when_necessary reporters = Minitest::Reporters.choose_reporters [], {"TM_PID" => "x"} assert_instance_of MiniTest::Reporters::RubyMateReporter, reporters[0] end def test_chooses_the_console_reporters_when_necessary reporters = Minitest::Reporters.choose_reporters [MiniTest::Reporters::SpecReporter.new], {} assert_instance_of MiniTest::Reporters::SpecReporter, reporters[0] end end end
Version data entries
17 entries across 17 versions & 1 rubygems