Sha256: 13a896ca7b24bca078d02b0224576e3129319c8ccdf083f37a3312b925daf702

Contents?: true

Size: 810 Bytes

Versions: 3

Compression:

Stored size: 810 Bytes

Contents

# frozen_string_literal: true

require "open3"

module AIRefactor
  module TestRunners
    class SteepRunner
      def initialize(file_path, command_template: "bundle exec steep __FILE__")
        @file_path = file_path
        @command_template = command_template
      end

      def command
        @command_template.gsub("__FILE__", @file_path)
      end

      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
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ai_refactor-0.6.0 lib/ai_refactor/test_runners/steep_runner.rb
ai_refactor-0.5.4 lib/ai_refactor/test_runners/steep_runner.rb
ai_refactor-0.5.3 lib/ai_refactor/test_runners/steep_runner.rb