defunkt/resque — pull request #708 by tarcieri (2012-10-01 20:22:11+00:00)
Title: Fix will_fork? handling for before_fork hooks

The intended behavior of before_fork, according to a comment:

lib/resque/worker.rb
258: # Only run before_fork hooks if we're actually going to fork

If this is the case, then this behavior was actually broken on e.g.
JRuby, as there was no guard on the invocation of the hook.

This adds that guard, and cleans up the tests to check will_fork? before
making assertions.