Sha256: 7062199277e748b697b7d636d4e5cdf7eb2c74af36d20a8a109c7e07c2ec78c1

Contents?: true

Size: 881 Bytes

Versions: 6

Compression:

Stored size: 881 Bytes

Contents

module Retest
  class Program
    attr_accessor :runner, :repository, :command
    def initialize(runner: nil, repository: nil, command: nil)
      @runner = runner
      @repository = repository
      @command = command
    end

    def run(modified, added, removed)
      repository.sync(added: added, removed: removed)
      runner.sync(added: added, removed: removed)
      system('clear 2>/dev/null') || system('cls 2>/dev/null')

      runner.run (modified + added).first, repository: repository
    end

    def diff(branch)
      raise "Git not installed" unless VersionControl::Git.installed?
      test_files = repository.find_tests VersionControl::Git.diff_files(branch)

      puts "Tests found:"
      test_files.each { |test_file| puts "  - #{test_file}" }

      puts "Running tests..."
      runner.run_all_tests command.format_batch(*test_files)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
retest-1.13.2 lib/retest/program.rb
retest-1.13.1 lib/retest/program.rb
retest-1.13.0 lib/retest/program.rb
retest-1.12.0 lib/retest/program.rb
retest-1.11.0 lib/retest/program.rb
retest-1.10.0 lib/retest/program.rb