Sha256: 3b0fb772c5098d9a5d0887c14b24a744eac6f6f0816cba276b4f6cb5d2f2db27

Contents?: true

Size: 550 Bytes

Versions: 7

Compression:

Stored size: 550 Bytes

Contents

# frozen_string_literal: true

module Chutney
  # service class to lint for avoiding outline for single example
  class AvoidOutlineForSingleExample < Linter
    def lint
      scenarios do |feature, scenario|
        next unless scenario.is_a? CukeModeler::Outline
        next unless scenario.examples

        next if scenario.examples.length > 1
        next if scenario.examples.first.rows.length > 2 # first row is the header

        add_issue(I18n.t('linters.avoid_outline_for_single_example'), feature, scenario)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
chutney-3.3.0 lib/chutney/linter/avoid_outline_for_single_example.rb
chutney-3.2.1 lib/chutney/linter/avoid_outline_for_single_example.rb
chutney-3.2.0 lib/chutney/linter/avoid_outline_for_single_example.rb
chutney-3.1.1 lib/chutney/linter/avoid_outline_for_single_example.rb
chutney-3.1.0 lib/chutney/linter/avoid_outline_for_single_example.rb
chutney-3.0.1 lib/chutney/linter/avoid_outline_for_single_example.rb
chutney-3.0.0 lib/chutney/linter/avoid_outline_for_single_example.rb