Sha256: d21d116c1bb638e86767a5abaeb30a058c848bc13d87b52d0972ed422d693f06

Contents?: true

Size: 1.75 KB

Versions: 107

Compression:

Stored size: 1.75 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 output_fault_backtrace(fault)
            backtrace = fault.location
            if backtrace.size == 1
              output(fault.test_name +
                     backtrace[0].sub(/\A(.+:\d+).*/, ' [\\1]') +
                     ":")
            else
              output(fault.test_name)
              backtrace.each do |entry|
                output(entry)
              end
            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

107 entries across 107 versions & 8 rubygems

Version Path
rhodes-7.6.0 spec/framework_spec/extensions/test-libs/test/unit/ui/emacs/testrunner.rb
rhodes-7.5.1 spec/framework_spec/extensions/test-libs/test/unit/ui/emacs/testrunner.rb
rhodes-7.4.1 spec/framework_spec/extensions/test-libs/test/unit/ui/emacs/testrunner.rb
rhodes-7.1.17 spec/framework_spec/extensions/test-libs/test/unit/ui/emacs/testrunner.rb
rhodes-6.2.0 spec/framework_spec/extensions/test-libs/test/unit/ui/emacs/testrunner.rb
rhodes-6.0.11 spec/framework_spec/extensions/test-libs/test/unit/ui/emacs/testrunner.rb
rhodes-5.5.18 spec/framework_spec/extensions/test-libs/test/unit/ui/emacs/testrunner.rb
rhodes-5.5.17 spec/framework_spec/extensions/test-libs/test/unit/ui/emacs/testrunner.rb
rhodes-5.5.15 spec/framework_spec/extensions/test-libs/test/unit/ui/emacs/testrunner.rb
rhodes-5.5.0.22 spec/framework_spec/extensions/test-libs/test/unit/ui/emacs/testrunner.rb
rhodes-5.5.2 spec/framework_spec/extensions/test-libs/test/unit/ui/emacs/testrunner.rb
rhodes-5.5.0.7 spec/framework_spec/extensions/test-libs/test/unit/ui/emacs/testrunner.rb
rhodes-5.5.0.3 spec/framework_spec/extensions/test-libs/test/unit/ui/emacs/testrunner.rb
rhodes-5.5.0 spec/framework_spec/extensions/test-libs/test/unit/ui/emacs/testrunner.rb
tauplatform-1.0.3 spec/framework_spec/extensions/test-libs/test/unit/ui/emacs/testrunner.rb
tauplatform-1.0.2 spec/framework_spec/extensions/test-libs/test/unit/ui/emacs/testrunner.rb
tauplatform-1.0.1 spec/framework_spec/extensions/test-libs/test/unit/ui/emacs/testrunner.rb
rhodes-3.5.1.12 spec/framework_spec/extensions/test-libs/test/unit/ui/emacs/testrunner.rb
rhodes-3.3.5 spec/framework_spec/extensions/test-libs/test/unit/ui/emacs/testrunner.rb
rhodes-3.4.2 spec/framework_spec/extensions/test-libs/test/unit/ui/emacs/testrunner.rb