cabbage-ex/cabbage

Generating .exs files

leifg opened this issue · 2 comments

leifg commented

If I understand correctly: for a .feature file to be executed, it needs to be referenced in a *_test.exs file.

That creates a problem when someone with little code knowledge adds (or changes the name of) the feature files.

I'm already the GlobalFeatures example to define steps independently from the individual features.

Is there an existing macro/script that will just go through the .feature files and create according exunit tests?

Theres nothing like that now. Are you not seeing an error if the file is not found when running the test? We are using File.read!/1 so you should see a file not found error when running the test.
https://github.com/cabbage-ex/cabbage/blob/master/lib/cabbage/feature.ex#L144

I'm not sure what else we should do beyond that. Are you asking for a sort of one time task to produce matching *.exs files that have "fill in the blank" implementations of each step?

That is out of scope for this library.
If there is some misunderstanding from my part, please open new ticket