Closed alexives closed 4 years ago
I'll have to think some about this one. I've been in that configuration hell with hooks before, but my team for the most part was able to manage with a single file. From a tool perspective I don't believe Cucumber cares at all where the hook is even defined as long as it is in a rb file that gets interpreted before the Cucumber tests begin. So we could have hook definitions hiding in our step definition files. I've not tested this yet.
I'll get back to you on this. If nothing else we have an example here for others to reference if they want to tweak their own version or dynamically overwrite it at run time.
TBH, right after this I convinced people on my team to stop using cucumber entirely and move all post deploy testing to rspec. So anyway, I'm going to go ahead and close this PR since it's now almost 4 years old.
I've been working on a project that manages a large number of hooks (probably too many, but that's what happens when you test lots of configurations I guess). To manage this we split it up into several files under a hooks directory. I guess we could rename them to match type_hooks.rb and that would work, but I think a directory tree works out cleaner.
The major issue I see here is if you had a file that was like "captain_hooks_env.rb" that had hooks in it, I guess that would be confusing. But at the end of the day, I guess it's your repos so if you want to merge this feel free. I figured I'd offer some of these things separately in case you had other ideas/plans about how to address this sort of thing.