From 8fdb4bc8f61391be185c1e65e37e83535f680a8c Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 2 Mar 2006 00:17:53 +0000 Subject: Added test:uncommitted to test changes since last checkin to Subversion (closes #4035) [technomancy@gmail.com] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3733 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- railties/CHANGELOG | 2 ++ railties/lib/tasks/testing.rake | 13 ++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/railties/CHANGELOG b/railties/CHANGELOG index 1920ebaf13..b7a0c231ce 100644 --- a/railties/CHANGELOG +++ b/railties/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Added test:uncommitted to test changes since last checkin to Subversion #4035 [technomancy@gmail.com] + * Help script/about print the correct svn revision when in a non-English locale. #4026 [babie7a0@ybb.ne.jp] * Add 'app' accessor to script/console as an instance of Integration::Session [Jamis Buck] diff --git a/railties/lib/tasks/testing.rake b/railties/lib/tasks/testing.rake index 6fedcdb7e3..293320b2df 100644 --- a/railties/lib/tasks/testing.rake +++ b/railties/lib/tasks/testing.rake @@ -35,6 +35,17 @@ namespace :test do t.verbose = true t.test_files = touched.uniq end + + desc 'Test changes since last checkin (only Subversion)' + Rake::TestTask.new(:uncommitted => "db:test:prepare") do |t| + changed_since_checkin = `svn status`.map { |path| path.chomp[7 .. -1] } + models = changed_since_checkin.delete_if { |path| not path =~ /app\/models\/.*\.rb/ } + tests = models.map { |model| "test/unit/#{File.basename(model, '.rb')}_test.rb" } + + t.libs << 'test' + t.verbose = true + t.test_files = tests.uniq + end desc "Run the unit tests in test/unit" Rake::TestTask.new(:units => "db:test:prepare") do |t| @@ -69,4 +80,4 @@ namespace :test do t.verbose = true end -end \ No newline at end of file +end -- cgit v1.2.3