Sha256: 19807153322946fab6ee881631c5cae3fb26a170874ad6bf193c8b3061291ff6

Contents?: true

Size: 546 Bytes

Versions: 3

Compression:

Stored size: 546 Bytes

Contents

module Retest
  class Command
    class Rails
      attr_reader :all, :file_system

      def initialize(all:, file_system: FileSystem)
        @file_system = file_system
        @all = all
      end

      def to_s
        return "#{root_command} <test>" unless all
        root_command
      end

      def run_all(*files, runner:)
        runner.run files.join(' ')
      end

      private

      def root_command
        return 'bin/rails test' if file_system.exist? 'bin/rails'

        'bundle exec rails test'
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
retest-1.4.0 lib/retest/command/rails.rb
retest-1.3.0 lib/retest/command/rails.rb
retest-1.3.0.pre lib/retest/command/rails.rb