edge badge
Namespace
Methods
F
N
R
S
T
Class Public methods
new(options = {})
# File railties/lib/rails/test_unit/runner.rb, line 76
def initialize(options = {})
  @options = options
end
run(arguments)
# File railties/lib/rails/test_unit/runner.rb, line 80
def self.run(arguments)
  options = Rails::TestRunner::Options.parse(arguments)
  Rails::TestRunner.new(options).run
end
Instance Public methods
find_method()
# File railties/lib/rails/test_unit/runner.rb, line 91
def find_method
  return @options[:name] if @options[:name]
  return unless @options[:line]
  method = test_methods.find do |location, test_method, start_line, end_line|
    location == @options[:filename] &&
      (start_line..end_line).include?(@options[:line].to_i)
  end
  method[1] if method
end
run()
# File railties/lib/rails/test_unit/runner.rb, line 85
def run
  $rails_test_runner = self
  ENV["RAILS_ENV"] = @options[:environment]
  run_tests
end
show_backtrace?()
# File railties/lib/rails/test_unit/runner.rb, line 101
def show_backtrace?
  @options[:backtrace]
end
test_files()
# File railties/lib/rails/test_unit/runner.rb, line 105
def test_files
  return [@options[:filename]] if @options[:filename]
  if @options[:patterns] && @options[:patterns].count > 0
    pattern = @options[:patterns]
  else
    pattern = "test/**/*_test.rb"
  end
  Rake::FileList[pattern]
end