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

Version Path
minitest-reporters-0.14.24 test/unit/minitest/reporters_test.rb
minitest-reporters-0.14.23 test/unit/minitest/reporters_test.rb
minitest-reporters-0.14.22 test/unit/minitest/reporters_test.rb
minitest-reporters-0.14.21 test/unit/minitest/reporters_test.rb
minitest-reporters-0.14.20 test/unit/minitest/reporters_test.rb
minitest-reporters-0.14.19 test/unit/minitest/reporters_test.rb
minitest-reporters-0.14.18 test/unit/minitest/reporters_test.rb
minitest-reporters-0.14.17 test/unit/minitest/reporters_test.rb
minitest-reporters-0.14.16 test/unit/minitest/reporters_test.rb
minitest-reporters-0.14.15 test/unit/minitest/reporters_test.rb
minitest-reporters-0.14.14 test/unit/minitest/reporters_test.rb
minitest-reporters-0.14.13 test/unit/minitest/reporters_test.rb
minitest-reporters-0.14.12 test/unit/minitest/reporters_test.rb
minitest-reporters-0.14.11 test/unit/minitest/reporters_test.rb
minitest-reporters-0.14.10 test/unit/minitest/reporters_test.rb
minitest-reporters-0.14.9 test/unit/minitest/reporters_test.rb
minitest-reporters-0.14.8 test/unit/minitest/reporters_test.rb