Class: AIRefactor::TestRunners::MinitestRunner
- Inherits:
-
Object
- Object
- AIRefactor::TestRunners::MinitestRunner
- Defined in:
- lib/ai_refactor/test_runners/minitest_runner.rb
Instance Method Summary collapse
- #command ⇒ Object
-
#initialize(file_path, command_template: "ruby __FILE__") ⇒ MinitestRunner
constructor
A new instance of MinitestRunner.
- #run ⇒ Object
Constructor Details
#initialize(file_path, command_template: "ruby __FILE__") ⇒ MinitestRunner
Returns a new instance of MinitestRunner.
8 9 10 11 |
# File 'lib/ai_refactor/test_runners/minitest_runner.rb', line 8 def initialize(file_path, command_template: "ruby __FILE__") @file_path = file_path @command_template = command_template end |
Instance Method Details
#command ⇒ Object
13 14 15 |
# File 'lib/ai_refactor/test_runners/minitest_runner.rb', line 13 def command @command_template.gsub("__FILE__", @file_path) end |
#run ⇒ Object
17 18 19 20 21 |
# File 'lib/ai_refactor/test_runners/minitest_runner.rb', line 17 def run stdout, stderr, status = Open3.capture3(command) _matched, runs, _assertions, failures, errors, skips = stdout.match(/(\d+) runs, (\d+) assertions, (\d+) failures, (\d+) errors, (\d+) skips/).to_a TestRunResult.new(stdout, stderr, status, runs, failures, skips, errors) end |