Sha256: 359c17d0f6df95563f16b28388c39a9275f887b4d9af44591c80c666164f12b9

Contents?: true

Size: 708 Bytes

Versions: 6

Compression:

Stored size: 708 Bytes

Contents

require_relative "cached_test_file"

module Retest
  module Runners
    class TestRunner < Runner
      include CachedTestFile

      def run(changed_file, repository:)
        self.cached_test_file = repository.find_test(changed_file)

        return print_file_not_found unless cached_test_file

        log("Test File Selected: #{cached_test_file}")
        system_run command.gsub('<test>', cached_test_file)
      end

      def sync(added:, removed:)
        purge_test_file(removed)
      end

      private

      def print_file_not_found
        log(<<~ERROR)
          404 - Test File Not Found
          Retest could not find a matching test file to run.
        ERROR
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
retest-2.0.0.pre lib/retest/runners/test_runner.rb
retest-1.13.2 lib/retest/runners/test_runner.rb
retest-1.13.1 lib/retest/runners/test_runner.rb
retest-1.13.0 lib/retest/runners/test_runner.rb
retest-1.12.0 lib/retest/runners/test_runner.rb
retest-1.11.0 lib/retest/runners/test_runner.rb