Sha256: d4c20c7b26cee94e90a33561e253d0149f4621d2ffff71a81d8b66edf254ba93

Contents?: true

Size: 441 Bytes

Versions: 9

Compression:

Stored size: 441 Bytes

Contents

require 'chutney/linter'

module Chutney
  # service class to lint for too clumsy scenarios
  class TooClumsy < Linter
    def lint
      filled_scenarios do |feature, scenario|
        characters = scenario[:steps].map { |step| step[:text].length }.inject(0, :+)
        next if characters < 400
        
        add_issue(
          I18n.t('linters.too_clumsy', length: characters), feature, scenario
        )
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
chutney-2.2.1 lib/chutney/linter/too_clumsy.rb
chutney-2.1.1 lib/chutney/linter/too_clumsy.rb
chutney-2.1.0 lib/chutney/linter/too_clumsy.rb
chutney-2.0.3.1 lib/chutney/linter/too_clumsy.rb
chutney-2.0.3 lib/chutney/linter/too_clumsy.rb
chutney-2.0.2 lib/chutney/linter/too_clumsy.rb
chutney-2.0.1 lib/chutney/linter/too_clumsy.rb
chutney-2.0.0 lib/chutney/linter/too_clumsy.rb
chutney-2.0.0.rc1 lib/chutney/linter/too_clumsy.rb