1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Move global Sidekiq option changes to before/after when testing redis

connection so it doesn't pollute the rest of the test suite.
This commit is contained in:
Brandon Hilkert 2013-01-26 16:17:27 -05:00
parent 35c562f9c4
commit 396bf6cd7a
2 changed files with 7 additions and 2 deletions

View file

@ -11,6 +11,13 @@ class TestRedisConnection < MiniTest::Unit::TestCase
end
describe "namespace" do
before do
Sidekiq.options[:namespace] = "xxx"
end
after do
Sidekiq.options[:namespace] = nil
end
it "uses a given :namespace" do
pool = Sidekiq::RedisConnection.create(:namespace => "xxx")
@ -18,7 +25,6 @@ class TestRedisConnection < MiniTest::Unit::TestCase
end
it "uses :namespace from Sidekiq.options" do
Sidekiq.options[:namespace] = "xxx"
pool = Sidekiq::RedisConnection.create
assert_equal "xxx", pool.checkout.namespace
end

View file

@ -32,7 +32,6 @@ class TestWeb < MiniTest::Unit::TestCase
get '/'
assert_equal 200, last_response.status
assert_match /status-idle/, last_response.body
refute_match /default/, last_response.body
end
it 'can display queues' do