aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails
diff options
context:
space:
mode:
authorGeorge Claghorn <george.claghorn@gmail.com>2012-12-09 00:04:36 -0500
committerGeorge Claghorn <george.claghorn@gmail.com>2012-12-09 00:04:36 -0500
commit6e0eb9235a75fb8e0be5b34d4ecdddcb3fa37cb8 (patch)
tree66bae14d7fa5ab87fae9e7de21014f3d8c1c8b27 /railties/lib/rails
parentbb8923dee093b615615cdfb83b34d1b0bb254f25 (diff)
downloadrails-6e0eb9235a75fb8e0be5b34d4ecdddcb3fa37cb8.tar.gz
rails-6e0eb9235a75fb8e0be5b34d4ecdddcb3fa37cb8.tar.bz2
rails-6e0eb9235a75fb8e0be5b34d4ecdddcb3fa37cb8.zip
Make code statistics rake task handle new test locations properly
As of 2a68f68aead9fd65ecac8062ca8efc15f5bab418: - Unit tests are now in test/models, instead of test/units - Functional tests are now in test/controllers, instead of test/functional - Helper tests are now in test/helpers, instead of test/units/helpers - Mailer tests are now in test/mailers, instead of test/functional Update the rake task for code statistics (`rake stats`) so that it recognizes files in the above locations as tests, and accurately calculates statistics such as "Test LOC" and "Code to Test Ratio." Safely handle Rails apps that still have tests in the old locations.
Diffstat (limited to 'railties/lib/rails')
-rw-r--r--railties/lib/rails/code_statistics.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/railties/lib/rails/code_statistics.rb b/railties/lib/rails/code_statistics.rb
index 1aed2796c1..039360fcf6 100644
--- a/railties/lib/rails/code_statistics.rb
+++ b/railties/lib/rails/code_statistics.rb
@@ -1,6 +1,12 @@
class CodeStatistics #:nodoc:
- TEST_TYPES = %w(Units Functionals Unit\ tests Functional\ tests Integration\ tests)
+ TEST_TYPES = ['Controller tests',
+ 'Helper tests',
+ 'Model tests',
+ 'Mailer tests',
+ 'Integration tests',
+ 'Functional tests (old)',
+ 'Unit tests (old)']
def initialize(*pairs)
@pairs = pairs