Skip to content

Commit

Permalink
Removed the redundant blank line between reports
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinrutherford committed Jun 28, 2009
1 parent 0783106 commit e64391f
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 1 deletion.
9 changes: 9 additions & 0 deletions features/rake_task.feature
@@ -0,0 +1,9 @@
@rake
Feature: RakeTask
In order to run reek as part of my CI process
As a developer
I want to create rake tasks to run reek

Scenario: reports no smells in reek's own source code
When I run rake reek
Then it succeeds
28 changes: 28 additions & 0 deletions features/reports.feature
@@ -0,0 +1,28 @@
@reports
Feature: Correclty 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

Scenario: two reports run together with indented smells
When I run reek spec/samples/two_smelly_files/*.rb
Then it fails with exit status 2
And it reports:
"""
spec/samples/two_smelly_files/dirty_one.rb -- 6 warnings:
Dirty has the variable name '@s' (Uncommunicative Name)
Dirty#a calls @s.title multiple times (Duplication)
Dirty#a calls puts(@s.title) multiple times (Duplication)
Dirty#a has the name 'a' (Uncommunicative Name)
Dirty#a/block has the variable name 'x' (Uncommunicative Name)
Dirty#a/block/block is nested (Nested Iterators)
spec/samples/two_smelly_files/dirty_two.rb -- 6 warnings:
Dirty has the variable name '@s' (Uncommunicative Name)
Dirty#a calls @s.title multiple times (Duplication)
Dirty#a calls puts(@s.title) multiple times (Duplication)
Dirty#a has the name 'a' (Uncommunicative Name)
Dirty#a/block has the variable name 'x' (Uncommunicative Name)
Dirty#a/block/block is nested (Nested Iterators)
"""

2 changes: 1 addition & 1 deletion lib/reek/report.rb
Expand Up @@ -95,7 +95,7 @@ def smelly_sources
end

def full_report
@sources.map { |src| src.full_report }.join("\n")
@sources.map { |src| src.full_report }.join
end
end
end
7 changes: 7 additions & 0 deletions spec/samples/two_smelly_files/dirty_one.rb
@@ -0,0 +1,7 @@
class Dirty
def a
puts @s.title
@s.map {|x| x.each {|key| key += 3}}
puts @s.title
end
end
7 changes: 7 additions & 0 deletions spec/samples/two_smelly_files/dirty_two.rb
@@ -0,0 +1,7 @@
class Dirty
def a
puts @s.title
@s.map {|x| x.each {|key| key += 3}}
puts @s.title
end
end

0 comments on commit e64391f

Please sign in to comment.