From 2d6da991fe8cc19bc48e5b973f6a08e0abd1c103 Mon Sep 17 00:00:00 2001 From: edogawaconan Date: Sat, 6 Dec 2014 01:01:17 +0900 Subject: [PATCH] Less cross-test thread variable pollution. --- test/test_helper.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/test_helper.rb b/test/test_helper.rb index 925b42ee..e67b7576 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -15,4 +15,14 @@ class ActiveSupport::TestCase t.rewind t end + + setup :reset_thread_variables + + private + + def reset_thread_variables + %w(danbooru-user danbooru-user_id).each do |x| + Thread.current[x] = nil + end + end end