Class: AIRefactor::TestRunners::SteepRunner
- Inherits:
-
Object
- Object
- AIRefactor::TestRunners::SteepRunner
- Defined in:
- lib/ai_refactor/test_runners/steep_runner.rb
Instance Method Summary collapse
- #command ⇒ Object
-
#initialize(file_path, command_template: "bundle exec steep __FILE__") ⇒ SteepRunner
constructor
A new instance of SteepRunner.
- #run ⇒ Object
Constructor Details
#initialize(file_path, command_template: "bundle exec steep __FILE__") ⇒ SteepRunner
Returns a new instance of SteepRunner.
8 9 10 11 |
# File 'lib/ai_refactor/test_runners/steep_runner.rb', line 8 def initialize(file_path, command_template: "bundle exec steep __FILE__") @file_path = file_path @command_template = command_template end |
Instance Method Details
#command ⇒ Object
13 14 15 |
# File 'lib/ai_refactor/test_runners/steep_runner.rb', line 13 def command @command_template.gsub("__FILE__", @file_path) end |
#run ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/ai_refactor/test_runners/steep_runner.rb', line 17 def run stdout, stderr, status = Open3.capture3(command) # TODO: parse output # look initally for Cannot find a configuration at Steepfile # # _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 |