Sha256: 597d1d7be030c326055ff9e017805618558ff17ad529f25fc8fce07b8bbd2d49

Contents?: true

Size: 463 Bytes

Versions: 2

Compression:

Stored size: 463 Bytes

Contents

require 'gherkin_lint/linter'

module GherkinLint
  # service class to lint for too clumsy scenarios
  class TooClumsy < Linter
    def lint
      filled_scenarios do |file, feature, scenario|
        characters = scenario['steps'].map { |step| step['name'].length }.inject(0, :+)
        next if characters < 400
        references = [reference(file, feature, scenario)]
        add_error(references, "Used #{characters} Characters")
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gherkin_lint-0.3.1 lib/gherkin_lint/linter/too_clumsy.rb
gherkin_lint-0.3.0 lib/gherkin_lint/linter/too_clumsy.rb