Top Level Namespace

Defined Under Namespace

Modules: Shindo

Instance Method Summary collapse

Instance Method Details

#run_in_thread(helpers, tests, thread_locals) ⇒ Object



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/shindo/bin.rb', line 48

def run_in_thread(helpers, tests, thread_locals)
  shindo = Thread.new {
    for key, value in thread_locals
      Thread.current[key] = value
    end
    for file in helpers
      unless Thread.main[:exit]
        load(file)
      end
    end
    for file in tests
      Thread.current[:file] = file
      unless Thread.main[:exit]
        load(file)
      end
    end
  }
  shindo.join
  if shindo[:reload]
    run_in_thread(helpers, tests, thread_locals)
  else
    @totals = shindo[:totals]
  end
end