Closed kfischer-okarin closed 6 years ago
@nestorsalceda Any thoughts/feedback on this? If this is a acceptable solution, then it would be nice to use it in production soon....
Hey @DerTraveler
This is an awesome work! Sorry for the delay, I messed with my notifications settings and didn't notice about this.
Let me to do some review, but I think it will be merged today.
Thanks another time!
It's merged! Thanks :metal:
I added two new example group contexts
shared_context
andincluded_context
.Any
shared_context
will not be executed on its own but will be inserted in any place where you use the contextincluded_context
with the same description .Example:
As demonstrated by the (maybe too simple?) tests, any examples defined inside the
included_context
will be added to those of the inserted shared context.I didn't add any special support for several hooks or anything, since it shouldn't be necessary... with the current architecture of mamba, any hook defined inside
included_context
will take precedence over any hook defined in the insertedshared_context
. If you want to combine hooks of the same kind (twobefore.each
, twoafter.all
), you can just wrap the included context in another context that defines the additional hooks.This will resolve Issue #90 (which I submitted myself some months ago)