Sha256: 2a6f92c7ae25f45314a81eed6f91cfb4d8934f5d971d1c2bb59dd42572f80773

Contents?: true

Size: 1.17 KB

Versions: 6

Compression:

Stored size: 1.17 KB

Contents

require 'test/unit/ui/testrunnerutilities'

module Test
  module Unit
    module UI
      class TestRunner
        extend TestRunnerUtilities

        attr_reader :listeners
        def initialize(suite, options={})
          if suite.respond_to?(:suite)
            @suite = suite.suite
          else
            @suite = suite
          end
          @options = options
          @listeners = @options[:listeners] || []
        end

        # Begins the test run.
        def start
          setup_mediator
          attach_to_mediator
          attach_listeners
          start_mediator
        end

        private
        def setup_mediator
          @mediator = TestRunnerMediator.new(@suite, @options)
        end

        def attach_listeners
          @listeners.each do |listener|
            listener.attach_to_mediator(@mediator)
          end
        end

        def start_mediator
          @mediator.run
        end

        def diff_target_string?(string)
          Assertions::AssertionMessage.diff_target_string?(string)
        end

        def prepare_for_diff(from, to)
          Assertions::AssertionMessage.prepare_for_diff(from, to)
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
es_cli-0.1.0 vendor/bundle/ruby/3.1.0/gems/test-unit-3.6.7/lib/test/unit/ui/testrunner.rb
test-unit-3.6.7 lib/test/unit/ui/testrunner.rb
test-unit-3.6.6 lib/test/unit/ui/testrunner.rb
test-unit-3.6.5 lib/test/unit/ui/testrunner.rb
test-unit-3.6.4 lib/test/unit/ui/testrunner.rb
test-unit-3.6.3 lib/test/unit/ui/testrunner.rb