Skip to content

Commit

Permalink
Fixed formatting for smell-free reports
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinrutherford committed Jul 1, 2009
1 parent e1767a3 commit 9917db8
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 2 deletions.
14 changes: 13 additions & 1 deletion features/reports.feature
@@ -1,5 +1,5 @@
@reports
Feature: Correclty formatted reports
Feature: Correctly formatted reports
In order to get the most out of reek
As a developer
I want to be able to parse reek's output simply and consistently
Expand All @@ -26,3 +26,15 @@ Feature: Correclty formatted reports
"""

Scenario: good files show headers consecutively
When I run reek spec/samples/three_clean_files/*.rb
Then it succeeds
And it reports:
"""
spec/samples/three_clean_files/clean_one.rb -- 0 warnings
spec/samples/three_clean_files/clean_three.rb -- 0 warnings
spec/samples/three_clean_files/clean_two.rb -- 0 warnings
"""


3 changes: 2 additions & 1 deletion lib/reek/report.rb
Expand Up @@ -58,7 +58,8 @@ def [](index) # :nodoc:
# this report, with a heading.
def full_report(desc)
result = header(desc, @report.length)
result += ":\n#{to_s}\n" if length > 0
result += ":\n#{to_s}" if length > 0
result += "\n"
result
end

Expand Down
6 changes: 6 additions & 0 deletions spec/samples/three_clean_files/clean_one.rb
@@ -0,0 +1,6 @@
class Clean
def assign
puts @sub.title
@sub.map {|para| para.name }
end
end
6 changes: 6 additions & 0 deletions spec/samples/three_clean_files/clean_three.rb
@@ -0,0 +1,6 @@
class Clean
def assign
puts @sub.title
@sub.map {|para| para.name }
end
end
6 changes: 6 additions & 0 deletions spec/samples/three_clean_files/clean_two.rb
@@ -0,0 +1,6 @@
class Clean
def assign
puts @sub.title
@sub.map {|para| para.name }
end
end

0 comments on commit 9917db8

Please sign in to comment.