Sha256: 1693f8c2d6bf0ba2adf8fe0b30ccfdb1bc272ed2882bd481592fa3468d35c121

Contents?: true

Size: 964 Bytes

Versions: 10

Compression:

Stored size: 964 Bytes

Contents

module CukeModeler
  module DialectHelper

    def self.set_dialect(dialect)
      @dialect = dialect
    end

    def self.feature_keyword
      get_word(@dialect['feature'])
    end

    def self.background_keyword
      get_word(@dialect['background'])
    end

    def self.scenario_keyword
      get_word(@dialect['scenario'])
    end

    def self.outline_keyword
      get_word(@dialect['scenarioOutline'] || @dialect['scenario_outline'])
    end

    def self.example_keyword
      get_word(@dialect['examples'])
    end

    def self.step_keyword
      get_word(@dialect['given']).strip
    end

    def self.given_keyword
      get_word(@dialect['given']).strip
    end

    def self.then_keyword
      get_word(@dialect['then']).strip
    end

    def self.get_word(word_set)
      word_set.is_a?(Array) ? word_set.first : word_set.split('|').first
    end


    private_class_method :get_word

  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
cuke_modeler-2.1.0 testing/dialect_helper.rb
cuke_modeler-2.0.0 testing/dialect_helper.rb
cuke_modeler-1.5.1 testing/dialect_helper.rb
cuke_modeler-1.5.0 testing/dialect_helper.rb
cuke_modeler-1.4.0 testing/dialect_helper.rb
cuke_modeler-1.3.0 testing/dialect_helper.rb
cuke_modeler-1.2.1 testing/dialect_helper.rb
cuke_modeler-1.2.0 testing/dialect_helper.rb
cuke_modeler-1.1.1 testing/dialect_helper.rb
cuke_modeler-1.1.0 testing/dialect_helper.rb