Sha256: 681755495c2aeb40e44aee409945398277d4820b6af5b7c7748fc95fd1df9f1b

Contents?: true

Size: 451 Bytes

Versions: 9

Compression:

Stored size: 451 Bytes

Contents

module Chutney
  # service class to lint for too many steps
  class TooManySteps < Linter
    def lint
      filled_scenarios do |feature, scenario|
        next if scenario[:steps].length <= maxcount
        
        add_issue(
          I18n.t('linters.too_many_steps', count: scenario[:steps].length, max: maxcount), 
          feature
        )
      end
    end
    
    def maxcount
      configuration['MaxCount']&.to_i || 10
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

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