Sha256: 9616f2e9a1df3f7d154ed379be6a179ff7ad49ebe6367770bbff16a420c29e59
Contents?: true
Size: 548 Bytes
Versions: 4
Compression:
Stored size: 548 Bytes
Contents
require 'gherkin_lint/linter' module GherkinLint # service class for check that there are multiple scenarios once a background is used class BackgroundRequiresMultipleScenarios < Linter def lint backgrounds do |file, feature, background| scenarios = feature[:children].reject { |element| element[:type] == :Background } next if scenarios.length >= 2 references = [reference(file, feature, background)] add_error(references, "There are just #{scenarios.length} scenarios") end end end end
Version data entries
4 entries across 4 versions & 1 rubygems