Sha256: 11f84e8b51c849bc7170207a2e4996fdbecf4da9818e3d721a878c29be40d177
Contents?: true
Size: 669 Bytes
Versions: 5
Compression:
Stored size: 669 Bytes
Contents
require 'gherkin_lint/linter' module GherkinLint # service class to lint for file name differs feature name class FileNameDiffersFeatureName < Linter def lint features do |file, feature| next unless feature.include? 'name' expected_feature_name = title_case file next unless feature['name'].downcase != expected_feature_name.downcase references = [reference(file, feature)] add_issue(references, "Feature name should be '#{expected_feature_name}'") end end def title_case(value) value = File.basename(value, '.feature') value.split('_').collect(&:capitalize).join(' ') end end end
Version data entries
5 entries across 5 versions & 1 rubygems