Class: TLDR::Runner
- Inherits:
-
Object
- Object
- TLDR::Runner
- Defined in:
- lib/tldr/runner.rb
Instance Method Summary collapse
-
#initialize ⇒ Runner
constructor
A new instance of Runner.
- #run(config, plan) ⇒ Object
Constructor Details
Instance Method Details
#run(config, plan) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/tldr/runner.rb', line 12 def run config, plan @wip.clear @results.clear reporter = config.reporter.new(config) reporter.before_suite(plan.tests) time_bomb = Thread.new { explode = proc do next if ENV["CI"] && !$stderr.tty? next if @run_aborted.true? @run_aborted.make_true @wip.each(&:capture_backtrace_at_exit) reporter.after_tldr(plan.tests, @wip.dup, @results.dup) exit!(3) end sleep(1.8) # Don't hard-kill the runner if user is debugging, it'll # screw up their terminal slash be a bad time if IRB.CurrentContext IRB.conf[:AT_EXIT] << explode else explode.call end } results = @executor.execute(plan) { |test| run_test(test, config, plan, reporter) }.tap do time_bomb.kill end unless @run_aborted.true? reporter.after_suite(results) exit(exit_code(results)) end end |