class Retest::Command::Rails

Attributes

all[R]
file_system[R]

Public Class Methods

new(all:, file_system: FileSystem) click to toggle source
# File lib/retest/command/rails.rb, line 6
def initialize(all:, file_system: FileSystem)
  @file_system = file_system
  @all = all
end

Public Instance Methods

run_all(*files, runner:) click to toggle source
# File lib/retest/command/rails.rb, line 16
def run_all(*files, runner:)
  runner.run files.join(' ')
end
to_s() click to toggle source
# File lib/retest/command/rails.rb, line 11
def to_s
  return "#{root_command} <test>" unless all
  root_command
end

Private Instance Methods

root_command() click to toggle source
# File lib/retest/command/rails.rb, line 22
def root_command
  return 'bin/rails test' if file_system.exist? 'bin/rails'

  'bundle exec rails test'
end