forked from troessner/reek
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replaced script_spec by stdin.feature
- Loading branch information
1 parent
a742dd9
commit 71133c4
Showing
4 changed files
with
49 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
@stdin | ||
Feature: Reek reads from $stdin when no files are given | ||
In order to use reek with pipelines | ||
As a developer | ||
I want to pipe source code on stdin | ||
|
||
Scenario: return zero status with no smells | ||
When I pass "def simple() @fred = 3 end" to reek | ||
Then it succeeds | ||
|
||
Scenario: outputs nothing on empty stdin | ||
When I pass "" to reek | ||
Then it succeeds | ||
And stdout equals "" | ||
|
||
Scenario: return non-zero status when there are smells | ||
When I pass "def x() 3; end" to reek | ||
Then it fails with exit status 2 | ||
|
||
Scenario: output nothing when no smells | ||
When I pass "def simple() @fred = 3; end" to reek | ||
Then it succeeds | ||
And stdout equals "" | ||
|
||
Scenario: report smells correctly | ||
When I pass "class Turn; def y() @x = 3; end end" to reek | ||
Then it fails with exit status 2 | ||
And it reports: | ||
""" | ||
Turn has the variable name '@x' (Uncommunicative Name) | ||
Turn#y has the name 'y' (Uncommunicative Name) | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.