class Chutney::AvoidOutlineForSingleExample

service class to lint for avoiding outline for single example

Public Instance Methods

lint() click to toggle source
# File lib/chutney/linter/avoid_outline_for_single_example.rb, line 6
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