Clean up Redis after each test.

This commit is contained in:
Guo Xiang Tan 2016-06-06 17:29:11 +08:00
parent 22e567c9b9
commit bb92be5784
No known key found for this signature in database
GPG Key ID: 19C321C8952B0F72
2 changed files with 3 additions and 4 deletions

View File

@ -75,8 +75,6 @@ describe Scheduler::Manager do
end
before do
$redis.del manager.class.lock_key
$redis.del manager.class.queue_key
manager.remove(Testing::RandomJob)
manager.remove(Testing::SuperLongJob)
manager.remove(Testing::PerHostJob)
@ -87,6 +85,7 @@ describe Scheduler::Manager do
manager.remove(Testing::RandomJob)
manager.remove(Testing::SuperLongJob)
manager.remove(Testing::PerHostJob)
$redis.flushall
end
describe 'per host jobs' do

View File

@ -20,11 +20,11 @@ describe Scheduler::ScheduleInfo do
before do
@info = manager.schedule_info(RandomJob)
@info.del!
$redis.del manager.class.queue_key
end
after do
manager.stop!
$redis.del manager.class.queue_key
end
it "is a scheduled job" do
@ -67,11 +67,11 @@ describe Scheduler::ScheduleInfo do
before do
@info = manager.schedule_info(DailyJob)
@info.del!
$redis.del manager.class.queue_key
end
after do
manager.stop!
$redis.del manager.class.queue_key
end
it "is a scheduled job" do