Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added test:uncommitted to test changes since last checkin to Subversi…
…on (closes #4035) [technomancy@gmail.com]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3733 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
dhh committed Mar 2, 2006
1 parent a434cec commit 8fdb4bc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions 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]
Expand Down
13 changes: 12 additions & 1 deletion railties/lib/tasks/testing.rake
Expand Up @@ -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|
Expand Down Expand Up @@ -69,4 +80,4 @@ namespace :test do

t.verbose = true
end
end
end

0 comments on commit 8fdb4bc

Please sign in to comment.