cabbage-ex / cabbage

Story BDD tool for executing elixir in ExUnit
MIT License
144 stars 34 forks source link

Behat-like usage #81

Closed lud closed 5 years ago

lud commented 5 years ago

Hello,

In the PHP world (like it or not) there is Behat. With that tool, you define feature files and Feature context, but those are independant.

It means that in a feature file you can use "givens" and "thens" from any context.

With cabbage, you to define a feature file on top of your context. Is it on purpoe ? What would you think about implementing feature-independant contexts ?

revati commented 5 years ago

Hello, I am from PHP background as well ;) I have used behat, but it was a few years ago.

I didn't quite catch your point. You can import step implementations from different files.

lud commented 5 years ago

But then you have to create almost empty files just to import context. I was thinking about something more "automatic" for the user.

But at least this is enough for what I need, thank you, I missed it in the docs !

revati commented 5 years ago

If I understand you correctly, there are the following parts in behat:

feature can load steps from context and execute scenarios defined in *.feature file?

lud commented 5 years ago

Well IIRC there is no need to define the feature part. You just write feature files and the Given/Then/When are available globally.

Maybe there is an option to restrict the contexts available to a particular feature, but I'm not sure.

revati commented 5 years ago

Global steps definition seems odd. At least how I use bdd. But I see value in defining all steps in context, and then all *.feature files are executed against specified context.

Maybe after 1.0