Class: Rails::TestTask

Inherits:
Rake::TestTask
  • Object
show all
Defined in:
railties/lib/rails/test_unit/sub_test_task.rb

Overview

:nodoc: all

Defined Under Namespace

Classes: TestCreator, TestInfo

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = :test) ⇒ TestTask

Returns a new instance of TestTask.



101
102
103
104
# File 'railties/lib/rails/test_unit/sub_test_task.rb', line 101

def initialize(name = :test)
  super
  @libs << "test" # lib *and* test seem like a better default
end

Class Method Details

.test_creator(tasks) ⇒ Object



96
97
98
99
# File 'railties/lib/rails/test_unit/sub_test_task.rb', line 96

def self.test_creator(tasks)
  info = TestInfo.new(tasks)
  TestCreator.new(info)
end

Instance Method Details

#defineObject



106
107
108
109
110
111
112
113
114
115
116
117
# File 'railties/lib/rails/test_unit/sub_test_task.rb', line 106

def define
  task @name do
    if ENV['TESTOPTS']
      ARGV.replace Shellwords.split ENV['TESTOPTS']
    end
    libs = @libs - $LOAD_PATH
    $LOAD_PATH.unshift(*libs)
    file_list.each { |fl|
      FileList[fl].to_a.each { |f| require File.expand_path f }
    }
  end
end