<commit_before># Test results reporter for RubyMine IDE (http://www.jetbrains.com/ruby/) and
# TeamCity(http://www.jetbrains.com/teamcity/) Continuous Integration Server

require 'ansi/code'
begin
  require 'teamcity/runner_common'
  require 'teamcity/utils/service_message_factory'
  require 'teamcity/utils/runner_utils'
  require 'teamcity/utils/url_formatter'
rescue LoadError
  puts("====================================================================================================\n")
  puts("RubyMine reporter works only if it test was launched using RubyMine IDE or TeamCity CI server !!!\n")
  puts("====================================================================================================\n")
  puts("Using default results reporter...\n")

  require "minitest/reporters/default_reporter"

  # delegate to default reporter
  module Minitest
    module Reporters
      class RubyMineReporter < DefaultReporter
      end
    end
  end
else
  module Minitest
    module Reporters
      class RubyMineReporter < BaseReporter
        include ANSI::Code

        include ::Rake::TeamCity::RunnerCommon
        include ::Rake::TeamCity::RunnerUtils
        include ::Rake::TeamCity::Utils::UrlFormatter

        def start
          super
          puts 'Started'
          puts

          # Setup test runner's MessageFactory
          set_message_factory(Rake::TeamCity::MessageFactory)
          log_test_reporter_attached

          # Report tests count:
          if ::Rake::TeamCity.is_in_idea_mode
            log(@message_factory.create_tests_count(total_count))
          elsif ::Rake::TeamCity.is_in_buildserver_mode
            log(@message_factory.create_progress_message("Starting.. (#{total_count} tests)"))
          end

        end

        def report
          super

          puts('Finished in %.5fs' % total_time)
          print('%d tests, %d assertions, ' % [count, assertions])
          print(red { '%d failures, %d errors, ' } % [failures, errors])
          print(yellow { '%d skips' } % skips)
          puts
        end

        def record(test)
          super
          unless test.passed?
            with_result(test) do |exception_msg, backtrace|
              if test.skipped?
                log(@message_factory.create_test_ignored(test.name, exception_msg, backtrace))
              elsif test.error?
                log(@message_factory.create_test_error(test.name, exception_msg, backtrace))
              else
                log(@message_factory.create_test_failed(test.name, exception_msg, backtrace))
              end
            end
          end
        end

        alias_method :output, :io
<commit_msg>Fixed typo<commit_after># Test results reporter for RubyMine IDE (http://www.jetbrains.com/ruby/) and
# TeamCity(http://www.jetbrains.com/teamcity/) Continuous Integration Server

require 'ansi/code'
begin
  require 'teamcity/runner_common'
  require 'teamcity/utils/service_message_factory'
  require 'teamcity/utils/runner_utils'
  require 'teamcity/utils/url_formatter'
rescue LoadError
  puts("====================================================================================================\n")
  puts("RubyMine reporter works only if it test was launched using RubyMine IDE or TeamCity CI server !!!\n")
  puts("====================================================================================================\n")
  puts("Using default results reporter...\n")

  require "minitest/reporters/default_reporter"

  # delegate to default reporter
  module Minitest
    module Reporters
      class RubyMineReporter < DefaultReporter
      end
    end
  end
else
  module Minitest
    module Reporters
      class RubyMineReporter < BaseReporter
        include ANSI::Code

        include ::Rake::TeamCity::RunnerCommon
        include ::Rake::TeamCity::RunnerUtils
        include ::Rake::TeamCity::Utils::UrlFormatter

        def start
          super
          puts 'Started'
          puts

          # Setup test runner's MessageFactory
          set_message_factory(Rake::TeamCity::MessageFactory)
          log_test_reporter_attached

          # Report tests count:
          if ::Rake::TeamCity.is_in_idea_mode
            log(@message_factory.create_tests_count(total_count))
          elsif ::Rake::TeamCity.is_in_buildserver_mode
            log(@message_factory.create_progress_message("Starting.. (#{total_count} tests)"))
          end

        end

        def report
          super

          puts('Finished in %.5fs' % total_time)
          print('%d tests, %d assertions, ' % [count, assertions])
          print(red '%d failures, %d errors, ' % [failures, errors])
          print(yellow '%d skips' % skips)
          puts
        end

        def record(test)
          super
          unless test.passed?
            with_result(test) do |exception_msg, backtrace|
              if test.skipped?
                log(@message_factory.create_test_ignored(test.name, exception_msg, backtrace))
              elsif test.error?
                log(@message_factory.create_test_error(test.name, exception_msg, backtrace))
              else
                log(@message_factory.create_test_failed(test.name, exception_msg, backtrace))
              end
            end
          end
        end

        alias_method :output, :io

{'fraction_non_alphanumeric': 0.15818147661093368, 'fraction_numerical': 0.00037572797294758596, 'mean_word_length': 2.6972222222222224, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1876448', 'n_tokens_mistral': 1459, 'n_tokens_neox': 1392, 'n_words': 325}