Sha256: aa3ccefe58f793a280e7cc8b6d8e13eb38f69c2df282f5ba1451def10b35c2c4

Contents?: true

Size: 1.28 KB

Versions: 12

Compression:

Stored size: 1.28 KB

Contents

require_relative "../../test_helper"

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

12 entries across 12 versions & 1 rubygems

Version Path
minitest-reporters-0.14.7 test/unit/minitest/reporters_test.rb
minitest-reporters-0.14.6 test/unit/minitest/reporters_test.rb
minitest-reporters-0.14.5 test/unit/minitest/reporters_test.rb
minitest-reporters-0.14.4 test/unit/minitest/reporters_test.rb
minitest-reporters-0.14.3 test/unit/minitest/reporters_test.rb
minitest-reporters-0.14.2 test/unit/minitest/reporters_test.rb
minitest-reporters-0.14.1 test/unit/minitest/reporters_test.rb
minitest-reporters-0.14.0 test/unit/minitest/reporters_test.rb
minitest-reporters-0.13.1 test/unit/minitest/reporters_test.rb
minitest-reporters-0.13.0 test/unit/minitest/reporters_test.rb
minitest-reporters-0.12.2 test/unit/minitest/reporters_test.rb
minitest-reporters-0.12.1 test/unit/minitest/reporters_test.rb