Class: Minitest::Queue::TestTimeRecorder

Inherits:
Reporters::BaseReporter
  • Object
show all
Defined in:
lib/minitest/queue/test_time_recorder.rb

Instance Method Summary collapse

Constructor Details

#initialize(build:, **options) ⇒ TestTimeRecorder

Returns a new instance of TestTimeRecorder.



5
6
7
8
# File 'lib/minitest/queue/test_time_recorder.rb', line 5

def initialize(build:, **options)
  super(options)
  @build = build
end

Instance Method Details

#record(test) ⇒ Object



10
11
12
13
14
# File 'lib/minitest/queue/test_time_recorder.rb', line 10

def record(test)
  return unless test.passed?
  test_duration_in_milliseconds = test.time * 1000
  @build.record(test.name, test_duration_in_milliseconds)
end