Sha256: 93ec7e50f24d0e2990469ca3c9db1afe5740f98470171338cf593ecbbbeee9a9

Contents?: true

Size: 460 Bytes

Versions: 12

Compression:

Stored size: 460 Bytes

Contents

# frozen_string_literal: true

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

12 entries across 12 versions & 1 rubygems

Version Path
chutney-3.8.1 lib/chutney/linter/too_clumsy.rb
chutney-3.8.0 lib/chutney/linter/too_clumsy.rb
chutney-3.7.0 lib/chutney/linter/too_clumsy.rb
chutney-3.6.0 lib/chutney/linter/too_clumsy.rb
chutney-3.5.0 lib/chutney/linter/too_clumsy.rb
chutney-3.3.0 lib/chutney/linter/too_clumsy.rb
chutney-3.2.1 lib/chutney/linter/too_clumsy.rb
chutney-3.2.0 lib/chutney/linter/too_clumsy.rb
chutney-3.1.1 lib/chutney/linter/too_clumsy.rb
chutney-3.1.0 lib/chutney/linter/too_clumsy.rb
chutney-3.0.1 lib/chutney/linter/too_clumsy.rb
chutney-3.0.0 lib/chutney/linter/too_clumsy.rb