diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-04-05 14:49:06 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-04-05 14:49:06 -0700 |
commit | 91efe3958a7618db4030dd6ee5d8693145fb7b94 (patch) | |
tree | d0a54aae66db97b515738a1ab67e01b367dead18 /railties/lib/rails/test_unit/sub_test_task.rb | |
parent | 2ac97df55230cdadce008a6b8993de52056779bb (diff) | |
parent | 01034d3be0d7c8c09b551ac612c4b18f86086dc5 (diff) | |
download | rails-91efe3958a7618db4030dd6ee5d8693145fb7b94.tar.gz rails-91efe3958a7618db4030dd6ee5d8693145fb7b94.tar.bz2 rails-91efe3958a7618db4030dd6ee5d8693145fb7b94.zip |
Merge branch 'railstest'
* railstest:
do not blow away the test database on every run
just check pending migrations in the current environment
check pending migrations against the test db
only match the default task
test no longer makes sense after requiring all test files
switch the testing tests to use rake
a test file can be provided to rake, e.g.:
switch to Rails::TestTask
default task should also be in the test env
ensure the schema checking is done in the dev connection
Revert "Update Rake tasks to call `rails test` instead"
Revert "Warning removed unused variable task_name"
apps that depend on active record should load fixtures
Diffstat (limited to 'railties/lib/rails/test_unit/sub_test_task.rb')
-rw-r--r-- | railties/lib/rails/test_unit/sub_test_task.rb | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/railties/lib/rails/test_unit/sub_test_task.rb b/railties/lib/rails/test_unit/sub_test_task.rb index 87b6f9b5a4..36657dbdd4 100644 --- a/railties/lib/rails/test_unit/sub_test_task.rb +++ b/railties/lib/rails/test_unit/sub_test_task.rb @@ -1,6 +1,28 @@ +require 'rake/testtask' + module Rails + class TestTask < Rake::TestTask # :nodoc: all + def initialize(name = :test) + super + @libs << "test" # lib *and* test seem like a better default + end + + 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 + end + # Silence the default description to cut down on `rake -T` noise. - class SubTestTask < Rake::TestTask + class SubTestTask < Rake::TestTask # :nodoc: def desc(string) # Ignore the description. end |