features/reports/yaml.feature in reek-1.5.1 vs features/reports/yaml.feature in reek-1.6.0
- old
+ new
@@ -9,80 +9,52 @@
And it reports this yaml:
"""
--- []
"""
- @masking
- Scenario: masked smells always appear
- When I run reek --yaml spec/samples/masked/dirty.rb
+ Scenario: Indicate smells and print them as yaml when using files
+ When I run reek --yaml spec/samples/standard_smelly/minimal_dirty.rb
Then the exit status indicates smells
And it reports this yaml:
"""
---
- - !ruby/object:Reek::SmellWarning
- location:
- lines:
- - 4
- - 6
- context: Dirty#a
- source: spec/samples/masked/dirty.rb
- smell:
- class: Duplication
- occurrences: 2
- subclass: DuplicateMethodCall
- call: "@s.title"
- message: calls @s.title twice
- status:
- is_active: true
- - !ruby/object:Reek::SmellWarning
- location:
- lines:
- - 5
- - 7
- context: Dirty#a
- source: spec/samples/masked/dirty.rb
- smell:
- class: Duplication
- occurrences: 2
- subclass: DuplicateMethodCall
- call: puts(@s.title)
- message: calls puts(@s.title) twice
- status:
- is_active: true
- - !ruby/object:Reek::SmellWarning
- location:
- lines:
- - 5
- context: Dirty#a
- source: spec/samples/masked/dirty.rb
- smell:
- class: NestedIterators
- depth: 2
- subclass: NestedIterators
- message: contains iterators nested 2 deep
- status:
- is_active: true
-
+ - smell_category: IrresponsibleModule
+ smell_type: IrresponsibleModule
+ source: spec/samples/standard_smelly/minimal_dirty.rb
+ context: C
+ lines:
+ - 1
+ message: has no descriptive comment
+ name: C
+ - smell_category: UncommunicativeName
+ smell_type: UncommunicativeModuleName
+ source: spec/samples/standard_smelly/minimal_dirty.rb
+ context: C
+ lines:
+ - 1
+ message: has the name 'C'
+ name: C
+ - smell_category: UncommunicativeName
+ smell_type: UncommunicativeMethodName
+ source: spec/samples/standard_smelly/minimal_dirty.rb
+ context: C#m
+ lines:
+ - 2
+ message: has the name 'm'
+ name: m
"""
- @stdin
- Scenario: return non-zero status when there are smells
+ Scenario: Indicate smells and print them as yaml when using STDIN
When I pass "class Turn; end" to reek --yaml
Then the exit status indicates smells
And it reports this yaml:
"""
---
- - !ruby/object:Reek::SmellWarning
- location:
- lines:
- - 1
- context: Turn
- source: $stdin
- smell:
- class: IrresponsibleModule
- subclass: IrresponsibleModule
- module_name: Turn
- message: has no descriptive comment
- status:
- is_active: true
-
+ - smell_category: IrresponsibleModule
+ smell_type: IrresponsibleModule
+ source: "$stdin"
+ context: Turn
+ lines:
+ - 1
+ message: has no descriptive comment
+ name: Turn
"""