cabbage-ex / cabbage

Story BDD tool for executing elixir in ExUnit
MIT License
138 stars 33 forks source link

Missing step advisor #14

Closed shdblowers closed 7 years ago

shdblowers commented 7 years ago

When Cabbage informs you of a missing step, it just copy + pastes what the Gherkin step was.

As a user it would be more useful if Cabbage did some of the work to turn that into the form of what the regex should look like so variables are captured with regex capture groups.

This is start of a larger piece of work to convert all things the Gherkin language says it captures as variables.

mgwidmann commented 7 years ago

Awesome, thanks! I was thinking about doing this but I didn't just to get the proof of concept out and then I haven't revisited.

mgwidmann commented 7 years ago

Excited for this PR! Lemme know when its ready for another pass! Thanks again

shdblowers commented 7 years ago

The plan is to implement support for numbers / strings / booleans / (anything else?).

And also implement the fact that variables found in the regex will be reflected in the vars argument.

Will hopefully be able to carry on work on this in this week.

:smile:

Just made this PR so there wasn't any repeated effort on this section of work.

mgwidmann commented 7 years ago

I think this looks good, lets finish this up and do the vars part of it as another PR.

shdblowers commented 7 years ago

Hi @mgwidmann got it working now to handle multiple capture groups for numbers, single and double quote strings :smile:

shdblowers commented 7 years ago

It could do with some refactoring around the join functions to make the code more DRY. And also make changes based on your comment about how exceptions are defined. However, I don't think I'm going to have another chance to work on this for about a week.

So feel free to make changes to this branch, or merge and make changes to master, or whatever.

mgwidmann commented 7 years ago

Sorry I haven't had much free time in the past few weeks! This is looking good, we'll get this into the next release.