Sha256: 8796b88bb1b91066e8296c3dde1ff87166d7a24c9408993d850b1f9247fed7d9

Contents?: true

Size: 880 Bytes

Versions: 5

Compression:

Stored size: 880 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

5 entries across 5 versions & 1 rubygems

Version Path
retest-1.9.0 lib/retest/program.rb
retest-1.8.0 lib/retest/program.rb
retest-1.7.0 lib/retest/program.rb
retest-1.6.2 lib/retest/program.rb
retest-1.6.1 lib/retest/program.rb