features/vertical_spacing.feature in tailor-1.0.0.alpha2 vs features/vertical_spacing.feature in tailor-1.0.0
- old
+ new
@@ -1,21 +1,9 @@
Feature: Vertical spacing
As a Ruby developer
I want to check my Ruby files for vertical spacing
- Background:
- Given my configuration file ".tailor" looks like:
- """
- Tailor.config do |config|
- config.file_set do
- max_code_lines_in_class 5
- max_code_lines_in_method 3
- trailing_newlines 0
- end
- end
- """
-
@bad_files
Scenario: Detect lack of newlines
Given a file named "not_enough_newlines.rb" with:
"""
def a_method
@@ -50,15 +38,24 @@
"""
When I run `tailor -d .`
Then the output should match /Total Problems.*0/
- @good_files @class_length
+ @multi_line @good_files
- @multi_line
+ @class_length
Scenario Outline: Classes/modules with <= configured lines
- Given <File> exists without a newline at the end
+ Given my configuration file ".tailor" looks like:
+ """
+ Tailor.config do |config|
+ config.file_set do |style|
+ style.max_code_lines_in_class 5
+ style.trailing_newlines 0
+ end
+ end
+ """
+ And <File> exists without a newline at the end
When I run `tailor -d -c .tailor <File>`
Then the output should match /Total Problems.*0/
And the exit status should be 0
Scenarios:
@@ -68,11 +65,19 @@
@bad_files @class_length
@multi_line
Scenario Outline: Lines with bad spacing around parens
- Given <File> exists without a newline at the end
+ Given my configuration file ".tailor" looks like:
+ """
+ Tailor.config do |config|
+ config.file_set do |style|
+ style.max_code_lines_in_class 5
+ end
+ end
+ """
+ And <File> exists without a newline at the end
When I run `tailor -d -c .tailor <File>`
Then the output should match /Total Problems.*<Problems>/
And the output should match /position: <Position>/
And the output should match /position: <Position 2>/
And the exit status should be 1
@@ -84,11 +89,20 @@
@good_files @method_length
@multi_line
Scenario Outline: Methods with <= configured lines
- Given <File> exists without a newline at the end
+ Given my configuration file ".tailor" looks like:
+ """
+ Tailor.config do |config|
+ config.file_set do |style|
+ style.max_code_lines_in_method 3
+ style.trailing_newlines 0
+ end
+ end
+ """
+ And <File> exists without a newline at the end
When I run `tailor -d -c .tailor <File>`
Then the output should match /Total Problems.*0/
And the exit status should be 0
Scenarios:
@@ -98,17 +112,24 @@
@bad_files @method_length
@multi_line
Scenario Outline: Lines with bad spacing around parens
- Given <File> exists without a newline at the end
+ Given my configuration file ".tailor" looks like:
+ """
+ Tailor.config do |config|
+ config.file_set do |style|
+ style.max_code_lines_in_method 3
+ end
+ end
+ """
+ And <File> exists without a newline at the end
When I run `tailor -d -c .tailor <File>`
Then the output should match /Total Problems.*<Problems>/
And the output should match /position: <Position>/
And the output should match /position: <Position 2>/
And the exit status should be 1
Scenarios:
| File | Position | Position 2 | Problems |
| v_spacing/1/method_too_long | 1:0 | | 1 |
| v_spacing/1/parent_method_too_long | 1:0 | | 1 |
-