diff options
author | Jamis Buck <jamis@37signals.com> | 2006-02-28 18:57:32 +0000 |
---|---|---|
committer | Jamis Buck <jamis@37signals.com> | 2006-02-28 18:57:32 +0000 |
commit | 1a91abe6450b5bcb2a7fe1de1494b12c34288e50 (patch) | |
tree | 7f9b9f0c938c4241f09dea1201c318fb3967d648 /railties/lib/tasks | |
parent | 9507f5dcc90e22a6355d048f7fe00476e852889f (diff) | |
download | rails-1a91abe6450b5bcb2a7fe1de1494b12c34288e50.tar.gz rails-1a91abe6450b5bcb2a7fe1de1494b12c34288e50.tar.bz2 rails-1a91abe6450b5bcb2a7fe1de1494b12c34288e50.zip |
Add integration test support to app generation and testing
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3702 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib/tasks')
-rw-r--r-- | railties/lib/tasks/statistics.rake | 17 | ||||
-rw-r--r-- | railties/lib/tasks/testing.rake | 14 |
2 files changed, 22 insertions, 9 deletions
diff --git a/railties/lib/tasks/statistics.rake b/railties/lib/tasks/statistics.rake index 01c944d558..87b89e5198 100644 --- a/railties/lib/tasks/statistics.rake +++ b/railties/lib/tasks/statistics.rake @@ -1,12 +1,13 @@ STATS_DIRECTORIES = [ - %w(Helpers app/helpers), - %w(Controllers app/controllers), - %w(APIs app/apis), - %w(Components components), - %w(Functional\ tests test/functional), - %w(Models app/models), - %w(Unit\ tests test/unit), - %w(Libraries lib/) + %w(Helpers app/helpers), + %w(Controllers app/controllers), + %w(APIs app/apis), + %w(Components components), + %w(Functional\ tests test/functional), + %w(Models app/models), + %w(Unit\ tests test/unit), + %w(Libraries lib/), + %w(Integration\ tests test/integration) ].collect { |name, dir| [ name, "#{RAILS_ROOT}/#{dir}" ] }.select { |name, dir| File.directory?(dir) } desc "Report code statistics (KLOCs, etc) from the application" diff --git a/railties/lib/tasks/testing.rake b/railties/lib/tasks/testing.rake index 6d846e1cc0..6fedcdb7e3 100644 --- a/railties/lib/tasks/testing.rake +++ b/railties/lib/tasks/testing.rake @@ -13,8 +13,13 @@ end desc 'Test all units and functionals' task :test do - Rake::Task["test:units"].invoke rescue got_error = true + Rake::Task["test:units"].invoke rescue got_error = true Rake::Task["test:functionals"].invoke rescue got_error = true + + if File.exist?("test/integration") + Rake::Task["test:integration"].invoke rescue got_error = true + end + raise "Test failures" if got_error end @@ -45,6 +50,13 @@ namespace :test do t.verbose = true end + desc "Run the integration tests in test/integration" + Rake::TestTask.new(:integration => "db:test:prepare") do |t| + t.libs << "test" + t.pattern = 'test/integration/**/*_test.rb' + t.verbose = true + end + desc "Run the plugin tests in vendor/plugins/**/test (or specify with PLUGIN=name)" Rake::TestTask.new(:plugins => :environment) do |t| t.libs << "test" |