aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2006-03-02 00:17:53 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2006-03-02 00:17:53 +0000
commit8fdb4bc8f61391be185c1e65e37e83535f680a8c (patch)
treebd06e000216b904670f9d23b320488060be15eea /railties/lib
parenta434cec2e64a4ace61990efac36222000044bcee (diff)
downloadrails-8fdb4bc8f61391be185c1e65e37e83535f680a8c.tar.gz
rails-8fdb4bc8f61391be185c1e65e37e83535f680a8c.tar.bz2
rails-8fdb4bc8f61391be185c1e65e37e83535f680a8c.zip
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
Diffstat (limited to 'railties/lib')
-rw-r--r--railties/lib/tasks/testing.rake13
1 files changed, 12 insertions, 1 deletions
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