Sha256: 60172243f844295647b6802465bae3a1023306edb37c26e290dcfd8676337f76

Contents?: true

Size: 520 Bytes

Versions: 3

Compression:

Stored size: 520 Bytes

Contents

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

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

      def run_all(*files, runner:)
        paths = files.map { |file| "require './#{file}';" }.join
        runner.run %Q{-e "#{paths}"}
      end

      def to_s
        if file_system.exist? 'Gemfile.lock'
          'bundle exec ruby <test>'
        else
          'ruby <test>'
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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