Sha256: a37a68be314dce8705439cd50c23cc4804047a927f49c21ac160cc6901f30d4d

Contents?: true

Size: 479 Bytes

Versions: 5

Compression:

Stored size: 479 Bytes

Contents

require 'chutney/linter'

module Chutney
  # service class to lint for missing scenario names
  class MissingScenarioName < Linter
    MESSAGE = 'All scenarios should have a name'.freeze
  
    def lint
      scenarios do |file, feature, scenario|
        name = scenario.key?(:name) ? scenario[:name].strip : ''
        references = [reference(file, feature, scenario)]
        next unless name.empty?
        
        add_error(references, MESSAGE)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
chutney-1.6.3 lib/chutney/linter/missing_scenario_name.rb
chutney-1.6.2 lib/chutney/linter/missing_scenario_name.rb
chutney-1.6.1 lib/chutney/linter/missing_scenario_name.rb
chutney-1.6.0 lib/chutney/linter/missing_scenario_name.rb
chutney-0.5.0 lib/chutney/linter/missing_scenario_name.rb