From 3c9beb3dab73013af83b90983f283b76625052b8 Mon Sep 17 00:00:00 2001 From: Eugene Bolshakov Date: Mon, 17 Nov 2008 21:55:56 -0600 Subject: Add helper test generators [#1199 state:resolved] Signed-off-by: Joshua Peek --- railties/lib/tasks/testing.rake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'railties/lib/tasks/testing.rake') 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 -- cgit v1.2.3