Sha256: aed945906002caa3e8e49f044970be153f3061c00268b4366231276d1294789a

Contents?: true

Size: 1.36 KB

Versions: 12

Compression:

Stored size: 1.36 KB

Contents

require_relative "../../test_helper"
require "minitest/mock"

module MinitestReportersTest
  class ReportersTest < Minitest::Test
    def test_chooses_the_rubymine_reporter_when_necessary
      # Rubymine reporter complains when RubyMine libs are not available, so
      # stub its #puts method out.
      $stdout.stub :puts, nil do
        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]
      end
    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

    def test_chooses_no_reporters_when_running_under_vim
      reporters = Minitest::Reporters.choose_reporters(
        [Minitest::Reporters::DefaultReporter.new], { "VIM" => "/usr/share/vim" })
      assert_equal nil, reporters
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
minitest-reporters-1.1.5 test/unit/minitest/reporters_test.rb
minitest-reporters-1.1.4 test/unit/minitest/reporters_test.rb
minitest-reporters-1.1.3 test/unit/minitest/reporters_test.rb
minitest-reporters-1.1.2 test/unit/minitest/reporters_test.rb
minitest-reporters-1.1.1 test/unit/minitest/reporters_test.rb
minitest-reporters-1.1.0 test/unit/minitest/reporters_test.rb
minitest-reporters-1.1.0.beta3 test/unit/minitest/reporters_test.rb
minitest-reporters-1.1.0.beta2 test/unit/minitest/reporters_test.rb
minitest-reporters-1.1.0.beta1 test/unit/minitest/reporters_test.rb
minitest-reporters-1.0.20 test/unit/minitest/reporters_test.rb
minitest-reporters-1.0.19 test/unit/minitest/reporters_test.rb
minitest-reporters-1.0.18 test/unit/minitest/reporters_test.rb