These are chat archives for Behat/Behat

15th
Oct 2018
Christian Sciberras
@uuf6429
Oct 15 2018 10:11
I've seen "exercise" mentioned in a few places around behat code and also some of the docs. What is it exactly? I couldn't find full documentation explaining it.
Ciaran McNulty
@ciaranmcnulty
Oct 15 2018 10:20
beforeExercise hook runs before the first suite
And afterExercise after the end of the last suite
Christian Sciberras
@uuf6429
Oct 15 2018 10:21
ok, so exercise is a bit like a whole "profile" in behat.yml terms?
Ciaran McNulty
@ciaranmcnulty
Oct 15 2018 10:22
Yeah the whole shebang
Christian Sciberras
@uuf6429
Oct 15 2018 10:23
Thanks, good to know! My next question, if I may: I'm trying to set up some fixtures setup/teardown in before/after feature.
The problem is that the hook has to be a static method.
Since my context receives some dependencies (which may have to be passed to the fixture), I won't be able to pass them during these two hooks.
So I went with a different approach which stinks of a hack.
In beforeScenario I check if the scenario is the first one and if it is, then set up the fixture.
Likewise, in afterScenario, if it is the last one, I teardown the fixture.
Should I be concerned or is it passable?