enkessler / cuke_modeler

A gem to model a Cucumber test suite.
MIT License
22 stars 7 forks source link

Cuke modeler crapping it's pants parsing feature text #4

Closed Donavan closed 8 years ago

Donavan commented 8 years ago

Cuke modeler can't explodes when parsing the feature text below.

@wip @entity_abstract @allow_base_target @document Feature: Abstract Entity. A summary of the contents of a book, article, or formal speech Schema Rule: abstract must have abstract context and (abstract section OR abstract sentence) Schema Rule: abstract may have language, machine translated flag Schema Rule: only 1 abstract section or abstrace sentence is present at a time Xfrm Rule: if abstract present in source, present in target Xfrm Rule: abstract context is passthrough Xfrm Rule: Language group is look up Xfrm Rule: machine translated flag= if Y passthrough. If N, drop attribute Xfrm Rule: if abstract unstructured [No keyword sections in source - See DD] use abstract sentence Xfrm Rule: if abstract structured [Has keyword sections in source - See DD] use abstract section # TODO: Is there a rule on how to order? Which abstract is first? Based on order in source? Sources: Casdocs (non-patents, patents), medline References: None for this entity

@schema_test Scenario Outline: Validate document can have 0 or many abstracts Given I have a source with of abstracts Then the corresponding target record also has of abstracts Examples: | number | document | | 0 | casdoc | | 1 | casdoc | | more than 2 | casdoc | | 0 | patent | | 1 | patent | | more than 2 | patent | | 0 | medline | | 1 | medline | | more than 2 | medline |

Error output: Error encountered while parsing 'features/domains/document/document_biblio/document_abstract/document_abstract.feature' Gherkin::CompositeParserException - Parser errors: (13:3): expected: #EOF, #Comment, #BackgroundLine, #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Empty, got 'Sources: Casdocs (non-patents, patents), medline' (14:3): expected: #EOF, #Comment, #BackgroundLine, #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Empty, got 'Reference s: None for this entity' c:/casnc/Ruby22/lib/ruby/gems/2.2.0/gems/cuke_modeler-0.4.1/lib/cuke_modeler/parsing.rb:27:in rescue in parse_text' c:/casnc/Ruby22/lib/ruby/gems/2.2.0/gems/cuke_modeler-0.4.1/lib/cuke_modeler/parsing.rb:24:inparse_text' c:/casnc/Ruby22/lib/ruby/gems/2.2.0/gems/cuke_modeler-0.4.1/lib/cuke_modeler/feature_file.rb:67:in parse_file' c:/casnc/Ruby22/lib/ruby/gems/2.2.0/gems/cuke_modeler-0.4.1/lib/cuke_modeler/feature_file.rb:24:ininitialize' c:/casnc/Ruby22/lib/ruby/gems/2.2.0/gems/cuke_modeler-0.4.1/lib/cuke_modeler/containing.rb:11:in new' c:/casnc/Ruby22/lib/ruby/gems/2.2.0/gems/cuke_modeler-0.4.1/lib/cuke_modeler/containing.rb:11:inbuild_child_element' c:/casnc/Ruby22/lib/ruby/gems/2.2.0/gems/cuke_modeler-0.4.1/lib/cuke_modeler/directory.rb:76:in block in build_director y' c:/casnc/Ruby22/lib/ruby/gems/2.2.0/gems/cuke_modeler-0.4.1/lib/cuke_modeler/directory.rb:69:ineach' c:/casnc/Ruby22/lib/ruby/gems/2.2.0/gems/cuke_modeler-0.4.1/lib/cuke_modeler/directory.rb:69:in build_directory' c:/casnc/Ruby22/lib/ruby/gems/2.2.0/gems/cuke_modeler-0.4.1/lib/cuke_modeler/directory.rb:30:ininitialize' c:/casnc/Ruby22/lib/ruby/gems/2.2.0/gems/cuke_modeler-0.4.1/lib/cuke_modeler/containing.rb:11:in new' c:/casnc/Ruby22/lib/ruby/gems/2.2.0/gems/cuke_modeler-0.4.1/lib/cuke_modeler/containing.rb:11:inbuild_child_element' c:/casnc/Ruby22/lib/ruby/gems/2.2.0/gems/cuke_modeler-0.4.1/lib/cuke_modeler/directory.rb:74:in block in build_director y' c:/casnc/Ruby22/lib/ruby/gems/2.2.0/gems/cuke_modeler-0.4.1/lib/cuke_modeler/directory.rb:69:ineach' c:/casnc/Ruby22/lib/ruby/gems/2.2.0/gems/cuke_modeler-0.4.1/lib/cuke_modeler/directory.rb:69:in build_directory' c:/casnc/Ruby22/lib/ruby/gems/2.2.0/gems/cuke_modeler-0.4.1/lib/cuke_modeler/directory.rb:30:ininitialize' c:/casnc/Ruby22/lib/ruby/gems/2.2.0/gems/cuke_modeler-0.4.1/lib/cuke_modeler/containing.rb:11:in new' c:/casnc/Ruby22/lib/ruby/gems/2.2.0/gems/cuke_modeler-0.4.1/lib/cuke_modeler/containing.rb:11:inbuild_child_element' c:/casnc/Ruby22/lib/ruby/gems/2.2.0/gems/cuke_modeler-0.4.1/lib/cuke_modeler/directory.rb:74:in block in build_director y' c:/casnc/Ruby22/lib/ruby/gems/2.2.0/gems/cuke_modeler-0.4.1/lib/cuke_modeler/directory.rb:69:ineach' c:/casnc/Ruby22/lib/ruby/gems/2.2.0/gems/cuke_modeler-0.4.1/lib/cuke_modeler/directory.rb:69:in build_directory' c:/casnc/Ruby22/lib/ruby/gems/2.2.0/gems/cuke_modeler-0.4.1/lib/cuke_modeler/directory.rb:30:ininitialize' c:/casnc/Ruby22/lib/ruby/gems/2.2.0/gems/cuke_modeler-0.4.1/lib/cuke_modeler/containing.rb:11:in new' c:/casnc/Ruby22/lib/ruby/gems/2.2.0/gems/cuke_modeler-0.4.1/lib/cuke_modeler/containing.rb:11:inbuild_child_element' c:/casnc/Ruby22/lib/ruby/gems/2.2.0/gems/cuke_modeler-0.4.1/lib/cuke_modeler/directory.rb:74:in block in build_director y' c:/casnc/Ruby22/lib/ruby/gems/2.2.0/gems/cuke_modeler-0.4.1/lib/cuke_modeler/directory.rb:69:ineach' c:/casnc/Ruby22/lib/ruby/gems/2.2.0/gems/cuke_modeler-0.4.1/lib/cuke_modeler/directory.rb:69:in build_directory' c:/casnc/Ruby22/lib/ruby/gems/2.2.0/gems/cuke_modeler-0.4.1/lib/cuke_modeler/directory.rb:30:ininitialize' c:/casnc/Ruby22/lib/ruby/gems/2.2.0/gems/cuke_modeler-0.4.1/lib/cuke_modeler/containing.rb:11:in new' c:/casnc/Ruby22/lib/ruby/gems/2.2.0/gems/cuke_modeler-0.4.1/lib/cuke_modeler/containing.rb:11:inbuild_child_element' c:/casnc/Ruby22/lib/ruby/gems/2.2.0/gems/cuke_modeler-0.4.1/lib/cuke_modeler/directory.rb:74:in block in build_director y' c:/casnc/Ruby22/lib/ruby/gems/2.2.0/gems/cuke_modeler-0.4.1/lib/cuke_modeler/directory.rb:69:ineach' c:/casnc/Ruby22/lib/ruby/gems/2.2.0/gems/cuke_modeler-0.4.1/lib/cuke_modeler/directory.rb:69:in build_directory' c:/casnc/Ruby22/lib/ruby/gems/2.2.0/gems/cuke_modeler-0.4.1/lib/cuke_modeler/directory.rb:30:ininitialize' c:/casnc/Ruby22/lib/ruby/gems/2.2.0/bundler/gems/cuke_cataloger-6ceabc48425d/lib/cuke_cataloger/unique_test_case_tagger. rb:105:in new' c:/casnc/Ruby22/lib/ruby/gems/2.2.0/bundler/gems/cuke_cataloger-6ceabc48425d/lib/cuke_cataloger/unique_test_case_tagger. rb:105:inset_test_suite_model' c:/casnc/Ruby22/lib/ruby/gems/2.2.0/bundler/gems/cuke_cataloger-6ceabc48425d/lib/cuke_cataloger/unique_test_case_tagger. rb:69:in validate_test_ids' C:/casnc/repos/edh-tests/.git-hooks/pre_commit/cuke_cataloger_check.rb:9:inrun' c:/casnc/Ruby22/lib/ruby/gems/2.2.0/gems/overcommit-0.34.2/lib/overcommit/hook/base.rb:45:in `block in run_and_transform '

enkessler commented 8 years ago

That is an exception being raised by the gherkin gem. You've got a comment in the middle of your description block and that is not allowed by the current grammar.