aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/test_unit/testing.rake
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails/test_unit/testing.rake')
-rw-r--r--railties/lib/rails/test_unit/testing.rake10
1 files changed, 8 insertions, 2 deletions
diff --git a/railties/lib/rails/test_unit/testing.rake b/railties/lib/rails/test_unit/testing.rake
index 38c14fcd6b..28dc40379b 100644
--- a/railties/lib/rails/test_unit/testing.rake
+++ b/railties/lib/rails/test_unit/testing.rake
@@ -1,3 +1,4 @@
+require 'rbconfig'
require 'rake/testtask'
# Monkey-patch to silence the description from Rake::TestTask to cut down on rake -T noise
@@ -62,7 +63,7 @@ end
module Kernel
def silence_stderr
old_stderr = STDERR.dup
- STDERR.reopen(Config::CONFIG['host_os'] =~ /mswin|mingw/ ? 'NUL:' : '/dev/null')
+ STDERR.reopen(RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ ? 'NUL:' : '/dev/null')
STDERR.sync = true
yield
ensure
@@ -72,7 +73,8 @@ end
desc 'Runs test:units, test:functionals, test:integration together (also available: test:benchmark, test:profile, test:plugins)'
task :test do
- errors = %w(test:units test:functionals test:integration).collect do |task|
+ tests_to_run = ENV['TEST'] ? ["test:single"] : %w(test:units test:functionals test:integration)
+ errors = tests_to_run.collect do |task|
begin
Rake::Task[task].invoke
nil
@@ -122,6 +124,10 @@ namespace :test do
end
Rake::Task['test:uncommitted'].comment = "Test changes since last checkin (only Subversion and Git)"
+ Rake::TestTask.new(:single => "test:prepare") do |t|
+ t.libs << "test"
+ end
+
TestTaskWithoutDescription.new(:units => "test:prepare") do |t|
t.libs << "test"
t.pattern = 'test/unit/**/*_test.rb'