From 2ddc298ffb32b53e67b5643310080f7bfcc8f595 Mon Sep 17 00:00:00 2001 From: David Genord II Date: Fri, 30 Nov 2012 11:14:34 -0500 Subject: [PATCH] Reset worker settings after each spec runs --- spec/message_sending_spec.rb | 6 ++++-- spec/worker_spec.rb | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/spec/message_sending_spec.rb b/spec/message_sending_spec.rb index cc85219fb..003a510a4 100644 --- a/spec/message_sending_spec.rb +++ b/spec/message_sending_spec.rb @@ -67,6 +67,10 @@ def tell end end + after do + Delayed::Worker.default_queue_name = nil + end + it "creates a new PerformableMethod job" do expect { job = "hello".delay.count('l') @@ -80,14 +84,12 @@ def tell Delayed::Worker.default_priority = 99 job = FairyTail.delay.to_s expect(job.priority).to eq(99) - Delayed::Worker.default_priority = 0 end it "sets default queue name" do Delayed::Worker.default_queue_name = 'abbazabba' job = FairyTail.delay.to_s expect(job.queue).to eq('abbazabba') - Delayed::Worker.default_queue_name = nil end it "sets job options" do diff --git a/spec/worker_spec.rb b/spec/worker_spec.rb index 8507707b7..cf0fbb8f8 100644 --- a/spec/worker_spec.rb +++ b/spec/worker_spec.rb @@ -7,6 +7,10 @@ Delayed::Worker.backend = @clazz end + after do + Delayed::Worker.backend = :test + end + it "sets the Delayed::Job constant to the backend" do expect(Delayed::Job).to eq(@clazz) end