Module: Leaks::Runner

Defined in:
lib/leaks/runner.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.ram_usageObject (readonly)

Returns the value of attribute ram_usage.



6
7
8
# File 'lib/leaks/runner.rb', line 6

def ram_usage
  @ram_usage
end

.runsObject (readonly)

Returns the value of attribute runs.



7
8
9
# File 'lib/leaks/runner.rb', line 7

def runs
  @runs
end

Class Method Details

.run(path = 'spec', verbose = false) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/leaks/runner.rb', line 10

def self.run(path = 'spec', verbose=false)
  @ram_usage = RAMUsage.new
  @paths     = Array(path)
  @out       = verbose ? $stdout : nil
  @err       = $stderr
  @runs      = 0
  @printer   = Thread.new { Printer.run }

  if defined?(ActiveRecord::Base)
    ActiveRecord::Base.logger = nil
  end

  RSpecRunner.run(@paths, @err, @out)

  loop do
    RSpecRunner.run([], @err, @out)
    @runs +=1
  end
end