aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/tasks
diff options
context:
space:
mode:
authorEugene Bolshakov <eugene.bolshakov@gmail.com>2008-11-17 21:55:56 -0600
committerJoshua Peek <josh@joshpeek.com>2008-11-17 21:56:39 -0600
commit3c9beb3dab73013af83b90983f283b76625052b8 (patch)
treeab5c1eabfe79142bfbac484abf31157516b751b3 /railties/lib/tasks
parentd22fe41cf87d781ce1af264b37ba3eca762b74c3 (diff)
downloadrails-3c9beb3dab73013af83b90983f283b76625052b8.tar.gz
rails-3c9beb3dab73013af83b90983f283b76625052b8.tar.bz2
rails-3c9beb3dab73013af83b90983f283b76625052b8.zip
Add helper test generators [#1199 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'railties/lib/tasks')
-rw-r--r--railties/lib/tasks/testing.rake8
1 files changed, 4 insertions, 4 deletions
diff --git a/railties/lib/tasks/testing.rake b/railties/lib/tasks/testing.rake
index 328bde7442..4242458672 100644
--- a/railties/lib/tasks/testing.rake
+++ b/railties/lib/tasks/testing.rake
@@ -7,7 +7,7 @@ def recent_tests(source_pattern, test_path, touched_since = 10.minutes.ago)
tests = []
source_dir = File.dirname(path).split("/")
source_file = File.basename(path, '.rb')
-
+
# Support subdirs in app/models and app/controllers
modified_test_path = source_dir.length > 2 ? "#{test_path}/" << source_dir[1..source_dir.length].join('/') : test_path
@@ -18,7 +18,7 @@ def recent_tests(source_pattern, test_path, touched_since = 10.minutes.ago)
# For modified files in app, run tests in subdirs too. ex. /test/functional/account/*_test.rb
test = "#{modified_test_path}/#{File.basename(path, '.rb').sub("_controller","")}"
FileList["#{test}/*_test.rb"].each { |f| tests.push f } if File.exist?(test)
-
+
return tests
end
@@ -63,7 +63,7 @@ namespace :test do
t.test_files = touched.uniq
end
Rake::Task['test:recent'].comment = "Test recent changes"
-
+
Rake::TestTask.new(:uncommitted => "db:test:prepare") do |t|
def t.file_list
if File.directory?(".svn")
@@ -82,7 +82,7 @@ namespace :test do
unit_tests.uniq + functional_tests.uniq
end
-
+
t.libs << 'test'
t.verbose = true
end