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.rake15
1 files changed, 11 insertions, 4 deletions
diff --git a/railties/lib/rails/test_unit/testing.rake b/railties/lib/rails/test_unit/testing.rake
index 28dc40379b..3d87529ad4 100644
--- a/railties/lib/rails/test_unit/testing.rake
+++ b/railties/lib/rails/test_unit/testing.rake
@@ -61,6 +61,7 @@ end
# Recreated here from Active Support because :uncommitted needs it before Rails is available
module Kernel
+ remove_method :silence_stderr # Removing old method to prevent method redefined warning
def silence_stderr
old_stderr = STDERR.dup
STDERR.reopen(RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ ? 'NUL:' : '/dev/null')
@@ -71,6 +72,8 @@ module Kernel
end
end
+task :default => :test
+
desc 'Runs test:units, test:functionals, test:integration together (also available: test:benchmark, test:profile, test:plugins)'
task :test do
tests_to_run = ENV['TEST'] ? ["test:single"] : %w(test:units test:functionals test:integration)
@@ -79,10 +82,14 @@ task :test do
Rake::Task[task].invoke
nil
rescue => e
- task
+ { :task => task, :exception => e }
end
end.compact
- abort "Errors running #{errors * ', '}!" if errors.any?
+
+ if errors.any?
+ puts errors.map { |e| "Errors running #{e[:task]}! #{e[:exception].inspect}" }.join("\n")
+ abort
+ end
end
namespace :test do
@@ -104,9 +111,9 @@ namespace :test do
Rake::TestTask.new(:uncommitted => "test:prepare") do |t|
def t.file_list
if File.directory?(".svn")
- changed_since_checkin = silence_stderr { `svn status` }.map { |path| path.chomp[7 .. -1] }
+ changed_since_checkin = silence_stderr { `svn status` }.split.map { |path| path.chomp[7 .. -1] }
elsif File.directory?(".git")
- changed_since_checkin = silence_stderr { `git ls-files --modified --others` }.map { |path| path.chomp }
+ changed_since_checkin = silence_stderr { `git ls-files --modified --others` }.split.map { |path| path.chomp }
else
abort "Not a Subversion or Git checkout."
end