Class: Taeval::Unittest::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/taeval/unittest/runner.rb

Instance Method Summary collapse

Constructor Details

#initialize(config, output, reporter) ⇒ Runner

Returns a new instance of Runner.



10
11
12
13
14
# File 'lib/taeval/unittest/runner.rb', line 10

def initialize(config, output, reporter)
  @config   = Config.new(config)
  @output   = output
  @reporter = reporter
end

Instance Method Details

#runObject



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/taeval/unittest/runner.rb', line 16

def run
  cp_original

  if !@config.cmd.nil?
    cmd = @config.cmd 
  elsif !@config.tool.nil?
    case @config.tool.to_sym
    when :gradle
      cmd = 'gradle test'
    else
      raise "Unittest: #{@config.tool} is not supported."
    end
  else
    raise 'Unittest: Unittest\'s tool or cmd should be defined.'
  end
  
  exec(cmd)
end