aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/tasks
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/tasks')
-rw-r--r--railties/lib/tasks/statistics.rake17
-rw-r--r--railties/lib/tasks/testing.rake14
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"