resque/resque — pull request #1157 by yaauie (2013-12-17 02:47:50+00:00)
Title: Failed Assertions Don't Fail Tests :rage:

File this one under facepalm.

In the following scenario, a failed assertion will get squashed [by the worker](https://github.com/resque/resque/blob/1c2e9d3282092d197ca3438369c3c7671ebf1832/lib/resque/worker.rb):

``` ruby
# ...
test '' do
@worker.work(0) do
# this block is
assert_equal( 5, 2+2 ) # raises assertion failed exception
end
# but at this point, nothing is raised, so the test succeeds.
end
```
Additionally, we have no guarantee that there is a job to process in the queue, in which case the block is not run at all.

This pattern occurs many times in the worker test in `1-x-stable`. We need to come up with a pattern for ensuring that:

- [ ] the block is run
- [ ] assertion failures actually cause the test to fail.