Class: TestRunner

Inherits:
Object
  • Object
show all
Defined in:
lib/sfb_scripts/test_running/test_runner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env) ⇒ TestRunner

Returns a new instance of TestRunner.



4
5
6
7
# File 'lib/sfb_scripts/test_running/test_runner.rb', line 4

def initialize(env)
  @shell = env[:shell]
  @all_engines_param = env[:all_engines]
end

Instance Attribute Details

#all_engines_paramObject (readonly)

Returns the value of attribute all_engines_param.



3
4
5
# File 'lib/sfb_scripts/test_running/test_runner.rb', line 3

def all_engines_param
  @all_engines_param
end

#shellObject (readonly)

Returns the value of attribute shell.



3
4
5
# File 'lib/sfb_scripts/test_running/test_runner.rb', line 3

def shell
  @shell
end

Instance Method Details

#run_files(tests) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/sfb_scripts/test_running/test_runner.rb', line 15

def run_files(tests)
  begin
    test_runner = test_collection_runner(tests.working_dir)
    test_files = tests.relative_paths.join(' ')

    shell.exec("#{test_runner} #{test_files}", dir: tests.working_dir)
  rescue TestCollection::MultipleWorkingDirectoriesError => e
    if run_across_engines?
      run_across_engines(tests)
    end
  end
end

#run_method(test) ⇒ Object



9
10
11
12
13
# File 'lib/sfb_scripts/test_running/test_runner.rb', line 9

def run_method(test)
  test_runner = named_test_runner(test.working_dir)

  shell.exec("#{test_runner} #{test.relative_path} --name=#{test.test_name}", dir: test.working_dir)
end