Sha256: b24ce91a5f82cd9e04cd2c604b99bdf6f66a63bb672429cc1b3f12944182fa5b

Contents?: true

Size: 637 Bytes

Versions: 11

Compression:

Stored size: 637 Bytes

Contents

require_relative 'gherkin_9_adapter'


module CukeModeler

  # NOT A PART OF THE PUBLIC API
  # An adapter that can convert the output of version 18.x of the *cucumber-gherkin* gem into input that is consumable
  # by this gem.
  class Gherkin18Adapter < Gherkin9Adapter

    # Adapts the AST sub-tree that is rooted at the given rule node.
    def adapt_rule(rule_ast)
      adapted_rule = super(rule_ast)

      clear_child_elements(adapted_rule, [[:rule, :tags]])

      # Tagging of Rules was added in Gherkin 18
      adapted_rule['tags'] = adapt_tags(rule_ast[:rule])

      adapted_rule
    end

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
cuke_modeler-3.20.0 lib/cuke_modeler/adapters/gherkin_18_adapter.rb
cuke_modeler-3.19.0 lib/cuke_modeler/adapters/gherkin_18_adapter.rb
cuke_modeler-3.18.0 lib/cuke_modeler/adapters/gherkin_18_adapter.rb
cuke_modeler-3.17.0 lib/cuke_modeler/adapters/gherkin_18_adapter.rb
cuke_modeler-3.16.0 lib/cuke_modeler/adapters/gherkin_18_adapter.rb
cuke_modeler-3.15.0 lib/cuke_modeler/adapters/gherkin_18_adapter.rb
cuke_modeler-3.14.0 lib/cuke_modeler/adapters/gherkin_18_adapter.rb
cuke_modeler-3.13.0 lib/cuke_modeler/adapters/gherkin_18_adapter.rb
cuke_modeler-3.12.0 lib/cuke_modeler/adapters/gherkin_18_adapter.rb
cuke_modeler-3.11.0 lib/cuke_modeler/adapters/gherkin_18_adapter.rb
cuke_modeler-3.10.0 lib/cuke_modeler/adapters/gherkin_18_adapter.rb