Class: Minitest::Distributed::Reporters::TestOrderReporter

Inherits:
Reporter
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/minitest/distributed/reporters/test_order_reporter.rb

Instance Method Summary collapse

Constructor Details

#initialize(io, options) ⇒ TestOrderReporter

Returns a new instance of TestOrderReporter.



11
12
13
14
15
# File 'lib/minitest/distributed/reporters/test_order_reporter.rb', line 11

def initialize(io, options)
  super
  @path = T.let(options.fetch(:test_order_file), String)
  @file = T.let(nil, T.nilable(File))
end

Instance Method Details

#prerecord(klass, name) ⇒ Object



24
25
26
27
# File 'lib/minitest/distributed/reporters/test_order_reporter.rb', line 24

def prerecord(klass, name)
  T.must(@file).puts("#{klass}##{name}")
  T.must(@file).flush
end

#reportObject



30
31
32
# File 'lib/minitest/distributed/reporters/test_order_reporter.rb', line 30

def report
  T.must(@file).close
end

#startObject



18
19
20
21
# File 'lib/minitest/distributed/reporters/test_order_reporter.rb', line 18

def start
  @file = File.open(@path, "w+")
  super
end