Class: Flakie::Engine
- Inherits:
-
Object
- Object
- Flakie::Engine
- Defined in:
- lib/flakie/engine.rb
Instance Method Summary collapse
-
#initialize(command, count:, reporter:) ⇒ Engine
constructor
A new instance of Engine.
- #run ⇒ Object
Constructor Details
Instance Method Details
#run ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/flakie/engine.rb', line 12 def run reporter.open count.times do |index| start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC) system(command, out: File::NULL, err: File::NULL) end_time = Process.clock_gettime(Process::CLOCK_MONOTONIC) duration = (end_time - start_time).round report.runs.append Run.new(status: $?.success?, duration: duration, number: index + 1) reporter.report(report) end reporter.close end |