Class: AppMap::Depends::TestRunner
- Defined in:
- lib/appmap/depends/test_runner.rb
Instance Method Summary collapse
- #build_environment_fn(framework) ⇒ Object
-
#initialize(test_files) ⇒ TestRunner
constructor
A new instance of TestRunner.
- #run ⇒ Object
- #select_tests_fn(framework) ⇒ Object
- #test_command_fn(framework) ⇒ Object
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 |
#run ⇒ Object
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 |