Class: RSpecTurbo::Runner
- Inherits:
-
Object
- Object
- RSpecTurbo::Runner
- Defined in:
- lib/rspec_turbo/runner.rb
Overview
Top-level orchestration: parse argv, set up the test databases, discover and plan the spec files, hand execution to the Executor, then print the report and (optionally) merge coverage. Exits non-zero on any failure.
Instance Method Summary collapse
-
#initialize(argv) ⇒ Runner
constructor
A new instance of Runner.
- #run ⇒ Object
Constructor Details
Instance Method Details
#run ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/rspec_turbo/runner.rb', line 15 def run FileUtils.mkdir_p(Config.log_dir) print_header setup_databases planner = plan(discover_files) FileUtils.rm_rf("coverage") if Config.coverage? display = Display.new(planner) executor = Executor.new(planner, display, @options.) results = executor.run wall_total = (Process.clock_gettime(Process::CLOCK_MONOTONIC) - executor.wall_started).round display.print_report(results, wall_total, @workers) merge_coverage if Config.coverage? exit((results.any? { |r| r[:status] == "FAIL" }) ? 1 : 0) end |