[rspec-users] cucumber hooks BeforeAll and AfterAll

Joaquin Rivera Padron joahking at gmail.com
Sun Feb 15 14:21:57 EST 2009

hey there,
the short version:
right now Cucumber provides hooks Before and After to be run around every
step, I have notice some use case where BeforeAll and AfterAll hooks would
be useful.
are ther plans that they be provided? what you think would be the best place
to do it (mother_step.rb)? any ideas about this could be accomplished?

the long version:

playing with culerity, which according to the author:
* when running cucumber culerity spawns a new jruby process (that's the
IO.popen call) - this way cucumber runs in plain old ruby (and you can work
with your models for test setup etc.) and only celerity runs in jruby
* from then on all communication has to go through pipes (in, out) so i am
passing the browser config through those pipes to the newsly spawned jruby
* when a test fails the jruby process doesn't get killed, that's the java
processes you see. don't have a good idea how to solve this yet. for now you
will have to kill those processes by hand.

that has improved since now there's a first attempt for built in support to
kill orfan java processes at:

culerity trick happen at step_definitions/common_celerity.rb Before and
After hooks, where you build and kill a spawned jruby around every step.
There it is easy to see the gain if we could do those in an around All steps

what do you think?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090215/ab2eba7a/attachment.html>

More information about the rspec-users mailing list