class Chutney::SameTagForAllScenarios
service class to lint for using same tag on all scenarios
Public Instance Methods
lint()
click to toggle source
# File lib/chutney/linter/same_tag_for_all_scenarios.rb, line 8 def lint lint_scenarios if feature&.scenarios lint_examples if feature&.scenarios end
lint_examples()
click to toggle source
# File lib/chutney/linter/same_tag_for_all_scenarios.rb, line 29 def lint_examples scenarios do |_feature, scenario| tags = example_tags(scenario) next if tags.nil? || tags.empty? next unless scenario.is_a? CukeModeler::Outline next unless scenario.examples.length > 1 tags.each do |tag| next if tag == 'skip' add_issue(I18n.t('linters.same_tag_for_all_scenarios.example_level', tag: tag), feature, scenario) end end end
lint_scenarios()
click to toggle source
# File lib/chutney/linter/same_tag_for_all_scenarios.rb, line 13 def lint_scenarios tags = scenario_tags return if tags.nil? || tags.empty? return unless feature.tests.length > 1 tags.each do |tag| next if tag == 'skip' add_issue( I18n.t('linters.same_tag_for_all_scenarios.feature_level', tag: tag), feature ) end end