class Chutney::AvoidTypographersQuotes
service class to lint for avoid scripting
Constants
- TYPOGRAPHER_QUOTES
Public Instance Methods
issue(feature, scenario, location)
click to toggle source
# File lib/chutney/linter/avoid_typographers_quotes.rb, line 35 def issue(feature, scenario, location) add_issue(I18n.t('linters.avoid_typographers_quotes'), feature, scenario, location) end
lint()
click to toggle source
# File lib/chutney/linter/avoid_typographers_quotes.rb, line 8 def lint scenarios do |feature, scenario| lint_steps(feature, scenario) example_count = scenario.is_a?(CukeModeler::Outline) ? scenario.examples.length : 0 next unless example_count.positive? lint_examples(feature, scenario) end end
lint_examples(feature, scenario)
click to toggle source
# File lib/chutney/linter/avoid_typographers_quotes.rb, line 25 def lint_examples(feature, scenario) scenario.examples.each do |example| example.rows.each do |row| row.cells.each do |cell| issue(feature, scenario, cell) if TYPOGRAPHER_QUOTES.any? { |tq| cell.value.include? tq } end end end end
lint_steps(feature, scenario)
click to toggle source
# File lib/chutney/linter/avoid_typographers_quotes.rb, line 19 def lint_steps(feature, scenario) scenario.steps.each do |step| issue(feature, scenario, step) if TYPOGRAPHER_QUOTES.any? { |tq| step.text.include? tq } end end