Sha256: 382a4bbf88b7f03dd13e02e1fea3510a9f81cb70ac7dd82f68bf0dca420e41a9

Contents?: true

Size: 1.34 KB

Versions: 34

Compression:

Stored size: 1.34 KB

Contents

require 'test/unit/ui/console/testrunner'

module Test
  module Unit
    module UI
      module Emacs
        class TestRunner < Console::TestRunner
          private
          def output_setup_end
          end

          def output_started
          end

          def format_fault(fault)
            return super unless fault.respond_to?(:label)
            format_method_name = "format_fault_#{fault.label.downcase}"
            if respond_to?(format_method_name, true)
              __send__(format_method_name, fault)
            else
              super
            end
          end

          def format_fault_failure(failure)
            if failure.location.size == 1
              location = failure.location[0]
              location_display = location.sub(/\A(.+:\d+).*/, ' [\\1]')
            else
              location_display = "\n" + failure.location.join("\n")
            end
            result = "#{failure.label}:\n"
            result << "#{failure.test_name}#{location_display}:\n"
            result << failure.message
            result
          end

          def format_fault_error(error)
            result = "#{error.label}:\n"
            result << "#{error.test_name}:\n"
            result << "#{error.message}\n"
            result << error.backtrace.join("\n")
            result
          end
        end
      end
    end
  end
end

Version data entries

34 entries across 32 versions & 7 rubygems

Version Path
tdiary-5.0.5 vendor/bundle/gems/test-unit-3.2.4/lib/test/unit/ui/emacs/testrunner.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/test-unit-3.2.3/lib/test/unit/ui/emacs/testrunner.rb
tdiary-5.0.5 vendor/bundle/gems/test-unit-3.2.3/lib/test/unit/ui/emacs/testrunner.rb
test-unit-3.2.4 lib/test/unit/ui/emacs/testrunner.rb
fluent-plugin-detect-memb-exceptions-0.0.2 vendor/bundle/ruby/2.0.0/gems/test-unit-3.2.3/lib/test/unit/ui/emacs/testrunner.rb
fluent-plugin-detect-memb-exceptions-0.0.1 vendor/bundle/ruby/2.0.0/gems/test-unit-3.2.3/lib/test/unit/ui/emacs/testrunner.rb
tdiary-5.0.4 vendor/bundle/gems/test-unit-3.2.3/lib/test/unit/ui/emacs/testrunner.rb
ruby-compiler-0.1.1 vendor/ruby/gems/test-unit-3.2.3/lib/test/unit/ui/emacs/testrunner.rb
test-unit-3.2.3 lib/test/unit/ui/emacs/testrunner.rb
test-unit-3.2.2 lib/test/unit/ui/emacs/testrunner.rb
tdiary-5.0.2 vendor/bundle/gems/test-unit-3.2.1/lib/test/unit/ui/emacs/testrunner.rb
test-unit-3.2.1 lib/test/unit/ui/emacs/testrunner.rb
tdiary-5.0.1 vendor/bundle/gems/test-unit-3.2.0/lib/test/unit/ui/emacs/testrunner.rb
windows-pr-1.2.5 vendor/bundle/ruby/2.2.0/gems/win32-api-1.6.0-universal-mingw32/vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/ui/emacs/testrunner.rb
test-unit-3.2.0 lib/test/unit/ui/emacs/testrunner.rb
win32-api-1.6.0-universal-mingw32 vendor/bundle/ruby/2.2.0/gems/test-unit-3.1.9/lib/test/unit/ui/emacs/testrunner.rb
test-unit-3.1.9 lib/test/unit/ui/emacs/testrunner.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/test-unit-3.1.8/lib/test/unit/ui/emacs/testrunner.rb
test-unit-3.1.8 lib/test/unit/ui/emacs/testrunner.rb
test-unit-3.1.7 lib/test/unit/ui/emacs/testrunner.rb