diff options
Diffstat (limited to 'railties')
-rw-r--r-- | railties/CHANGELOG | 2 | ||||
-rw-r--r-- | railties/lib/tasks/testing.rake | 13 |
2 files changed, 14 insertions, 1 deletions
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 |