seomoz/qless — pull request #159 by myronmarston (2013-10-25 18:17:24+00:00)
Title: Fix our redis management for integration tests.

Before, we detected that the redis instance had keys
in a `before(:each)` hook, and made the spec pending.
This was intended to keep us from blowing away data
the user might find useful. However, we also had an
`after(:each)` hook that flushed the DB anyway,
so it didn't really serve it's purpose.

This improved version now checks if the redis DB
is empty in a `before(:suite)` hook, aborting early
if it sees there are keys in the DB. This ensures
we never flush the DB if it starts non-empty. It
has the nice side benefit of calling `redis.keys`
(an O(N) operation generally best avoided) once total,
rather than once per spec.