Class: AppMap::Depends::TestRunner

Inherits:
Object
  • Object
show all
Defined in:
lib/appmap/depends/test_runner.rb

Instance Method Summary collapse

Constructor Details

#initialize(test_files) ⇒ TestRunner

Returns a new instance of TestRunner.



49
50
51
# File 'lib/appmap/depends/test_runner.rb', line 49

def initialize(test_files)
  @test_files = test_files
end

Instance Method Details

#build_environment_fn(framework) ⇒ Object



59
60
61
62
63
64
65
# File 'lib/appmap/depends/test_runner.rb', line 59

def build_environment_fn(framework)
  lookup_method("#{framework}_environment_method") do |method|
    lambda do
      method.call
    end
  end
end

#runObject



53
54
55
56
57
# File 'lib/appmap/depends/test_runner.rb', line 53

def run
  %i[rspec minitest].each do |framework|
    run_tests select_tests_fn(framework), build_environment_fn(framework), test_command_fn(framework)
  end
end

#select_tests_fn(framework) ⇒ Object



67
68
69
70
71
72
73
# File 'lib/appmap/depends/test_runner.rb', line 67

def select_tests_fn(framework)
  lookup_method("#{framework}_select_tests_method") do |method|
    lambda do |test_files|
      method.call(test_files)
    end
  end
end

#test_command_fn(framework) ⇒ Object



75
76
77
78
79
80
81
# File 'lib/appmap/depends/test_runner.rb', line 75

def test_command_fn(framework)
  lookup_method("#{framework}_test_command_method") do |method|
    lambda do |test_files|
      method.call(test_files)
    end
  end
end