cabbage-ex / gherkin

A Gherkin file parser written in Elixir. Extracted from https://github.com/meadsteve/white-bread.
11 stars 8 forks source link

Add line numbers #3

Closed mgwidmann closed 7 years ago

mgwidmann commented 7 years ago

@meadsteve This should help with https://github.com/cabbage-ex/cabbage/pull/15 since I don't have the correct info to be able to mark each test with the proper line number from the .feature file...

mgwidmann commented 7 years ago

Yeah, actually that would be harder to add in since the parser is only handed a string. I think we'd have to expose a parse_file/1 function that would take in a file name, read it, and attach the name to the feature on the way out.

Cabbage does expose an @feature variable that is available, so maybe being able to do @feature.file to know which file is currently being run would be useful to users.

mgwidmann commented 7 years ago

I've added the filename to the feature for a start... If we think its necessary on every step we can add that later