Browse files

Fix typo and add sanity test for code statistics rake task.

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
1 parent 51e8435 commit 63039b9c3356f73421b3742134959014d81973b0 @miloops miloops committed with josevalim Sep 24, 2010
Showing with 7 additions and 2 deletions.
  1. +1 −1 railties/lib/rails/code_statistics.rb
  2. +6 −1 railties/test/application/rake_test.rb
View
2 railties/lib/rails/code_statistics.rb
@@ -23,7 +23,7 @@ def to_s
private
def calculate_statistics
- Hash[@pais.map { |pair| [pair.first, calculate_directory_statistics(pair.last)] }]
+ Hash[@pairs.map{|pair| [pair.first, calculate_directory_statistics(pair.last)]}]
end
def calculate_directory_statistics(directory, pattern = /.*\.rb$/)
View
7 railties/test/application/rake_test.rb
@@ -33,5 +33,10 @@ def test_environment_is_required_in_rake_tasks
assert_match "SuperMiddleware", Dir.chdir(app_path){ `rake middleware` }
end
+
+ def test_code_statistics_sanity
+ assert_match "Code LOC: 5 Test LOC: 0 Code to Test Ratio: 1:0.0",
+ Dir.chdir(app_path){ `rake stats` }
+ end
end
-end
+end

0 comments on commit 63039b9

Please sign in to comment.