Sha256: a82968fd3ee3d1c68d520b422557d6f546aeb1b7d8021e7006885dd1a4e73f85
Contents?: true
Size: 1.09 KB
Versions: 4
Compression:
Stored size: 1.09 KB
Contents
# frozen_string_literal: true require 'cucumber/messages' require 'json' module Gherkin DIALECT_FILE_PATH = File.expand_path('gherkin-languages.json', File.dirname(__FILE__)) DIALECTS = JSON.parse File.open(DIALECT_FILE_PATH, 'r:UTF-8').read class Dialect def self.for(name) spec = DIALECTS[name] return nil unless spec new(spec) end def initialize(spec) @spec = spec end def feature_keywords @spec.fetch('feature') end def rule_keywords @spec.fetch('rule') end def scenario_keywords @spec.fetch('scenario') end def scenario_outline_keywords @spec.fetch('scenarioOutline') end def examples_keywords @spec.fetch('examples') end def background_keywords @spec.fetch('background') end def given_keywords @spec.fetch('given') end def when_keywords @spec.fetch('when') end def then_keywords @spec.fetch('then') end def and_keywords @spec.fetch('and') end def but_keywords @spec.fetch('but') end end end
Version data entries
4 entries across 4 versions & 1 rubygems