Class: GherkinLint::TooClumsy

Inherits:
Linter
  • Object
show all
Defined in:
lib/gherkin_lint/linter/too_clumsy.rb

Overview

service class to lint for too clumsy scenarios

Instance Attribute Summary

Attributes inherited from Linter

#issues

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

#lintObject



6
7
8
9
10
11
12
13
# File 'lib/gherkin_lint/linter/too_clumsy.rb', line 6

def lint
  filled_scenarios do |file, feature, scenario|
    characters = scenario[:steps].map { |step| step[:text].length }.inject(0, :+)
    next if characters < 400
    references = [reference(file, feature, scenario)]
    add_error(references, "Used #{characters} Characters")
  end
end