Sha256: b15860f13162948bb71920d9145025bbd259ec947c72ddd89664e75f1da46cba

Contents?: true

Size: 845 Bytes

Versions: 12

Compression:

Stored size: 845 Bytes

Contents

module Retest
  module Runners
    class Runner
      include Observable

      attr_accessor :command, :stdout
      def initialize(command, stdout: $stdout)
        @stdout  = stdout
        @command = command
      end

      def ==(obj)
        command == obj.command && obj.class == self.class
      end

      def run(changed_file = nil, repository: nil)
        system_run command
      end

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

      def sync(added:, removed:)
      end

      private

      def system_run(command)
        result = system(command) ? :tests_pass : :tests_fail
        changed
        notify_observers(result)
      end

      def log(message)
        stdout.puts(message)
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
retest-2.0.0.pre lib/retest/runners/runner.rb
retest-1.13.2 lib/retest/runners/runner.rb
retest-1.13.1 lib/retest/runners/runner.rb
retest-1.13.0 lib/retest/runners/runner.rb
retest-1.12.0 lib/retest/runners/runner.rb
retest-1.11.0 lib/retest/runners/runner.rb
retest-1.10.0 lib/retest/runners/runner.rb
retest-1.9.0 lib/retest/runners/runner.rb
retest-1.8.0 lib/retest/runners/runner.rb
retest-1.7.0 lib/retest/runners/runner.rb
retest-1.6.2 lib/retest/runners/runner.rb
retest-1.6.1 lib/retest/runners/runner.rb