These are chat archives for pjlsergeant/test-bdd-cucumber-perl

5th
Jun 2017
Viacheslav Tykhanovskyi
@vti
Jun 05 2017 14:04
hi guys, we're having a strange problem, we have step definitions file that requires another step definitions file, it's all works nice when we run a single feature test, but if we run a directory, the first test passes but the rest fail with 'no matcher for'
if we don't use require and just copy paste it's all good
Viacheslav Tykhanovskyi
@vti
Jun 05 2017 14:11
if we use do instead of requires it seems to work too
Erik Huelsmann
@ehuelsmann
Jun 05 2017 14:32
you mean each file "require's the other steps?
@vti ^^^ ?
that can be explained by the fact that use and require remember which files have been loaded. So, once you successfully required the file, the other step files won't load the steps.
or am I misunderstanding?
Viacheslav Tykhanovskyi
@vti
Jun 05 2017 15:40
yeah, that's how require works, but that's kinda confusing, since i was expecting step definitions to be reloaded cleanly every time, those tests are using the same steps file, so it either shouldn't be reloaded or loaded cleaning up the namespace or smth like that
Erik Huelsmann
@ehuelsmann
Jun 05 2017 16:14
that's actually unexpected indeed.
I thought you were requiring from different directories.
that's not the case?
Viacheslav Tykhanovskyi
@vti
Jun 05 2017 16:16
no, it's the same directory, same steps file and that file requires some 'basic_steps'
Erik Huelsmann
@ehuelsmann
Jun 05 2017 16:19
ok. I do something like that using a extension.
the extension declares the step files that it provides to the tests.
pherkin loads those step files for every feature it wants to execute.
whether that means multiple times loading or not, I have no clue.