Class: ParallelTests::Gherkin::RuntimeLogger
- Inherits:
-
Object
- Object
- ParallelTests::Gherkin::RuntimeLogger
show all
- Includes:
- Io
- Defined in:
- lib/parallel_tests/gherkin/runtime_logger.rb
Instance Method Summary
collapse
Methods included from Io
#lock_output, #prepare_io
Constructor Details
#initialize(step_mother, path_or_io, options = nil) ⇒ RuntimeLogger
Returns a new instance of RuntimeLogger.
8
9
10
11
|
# File 'lib/parallel_tests/gherkin/runtime_logger.rb', line 8
def initialize(step_mother, path_or_io, options=nil)
@io = prepare_io(path_or_io)
@example_times = Hash.new(0)
end
|
Instance Method Details
#after_feature(feature) ⇒ Object
17
18
19
|
# File 'lib/parallel_tests/gherkin/runtime_logger.rb', line 17
def after_feature(feature)
@example_times[feature.file] += ParallelTests.now.to_f - @start_at
end
|
#after_features(*args) ⇒ Object
21
22
23
24
25
|
# File 'lib/parallel_tests/gherkin/runtime_logger.rb', line 21
def after_features(*args)
lock_output do
@io.puts @example_times.map { |file, time| "#{file}:#{time}" }
end
end
|
#before_feature(_) ⇒ Object
13
14
15
|
# File 'lib/parallel_tests/gherkin/runtime_logger.rb', line 13
def before_feature(_)
@start_at = ParallelTests.now.to_f
end
|