class CukeLinter::TestWithTooManyStepsLinter
A linter that detects scenarios and outlines that have too many steps
Public Instance Methods
configure(options)
click to toggle source
Changes the linting settings on the linter using the provided configuration
# File lib/cuke_linter/linters/test_with_too_many_steps_linter.rb, line 8 def configure(options) @step_threshold = options['StepThreshold'] if options['StepThreshold'] end
message()
click to toggle source
The message used to describe the problem that has been found
# File lib/cuke_linter/linters/test_with_too_many_steps_linter.rb, line 23 def message "Test has too many steps. #{@linted_step_count} steps found (max #{@linted_step_threshold})." end
rule(model)
click to toggle source
The rule used to determine if a model has a problem
# File lib/cuke_linter/linters/test_with_too_many_steps_linter.rb, line 13 def rule(model) return false unless model.is_a?(CukeModeler::Scenario) || model.is_a?(CukeModeler::Outline) @linted_step_count = model.steps.nil? ? 0 : model.steps.count @linted_step_threshold = @step_threshold || 10 @linted_step_count > @linted_step_threshold end