Class: GherkinLint::MissingExampleName
- Defined in:
- lib/gherkin_lint/linter/missing_example_name.rb
Overview
service class to lint for missing example names
Instance Attribute Summary
Attributes inherited from Linter
Instance Method Summary collapse
Methods inherited from Linter
#add_error, #add_warning, #backgrounds, descendants, #elements, #features, #files, #filled_scenarios, #filter_tag, #initialize, #line, #lint_files, #name, #reference, #render_step, #render_step_argument, #scenarios, #steps, #suppress, #suppress_tags, #tag?
Constructor Details
This class inherits a constructor from GherkinLint::Linter
Instance Method Details
#lint ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/gherkin_lint/linter/missing_example_name.rb', line 6 def lint scenarios do |file, feature, scenario| next unless scenario.key? :examples next unless scenario[:examples].length > 1 scenario[:examples].each do |example| name = example.key?(:name) ? example[:name].strip : '' next unless name.empty? references = [reference(file, feature, scenario)] add_error(references, 'No Example Name') end end end |