Sha256: 0039550af39d76678113a6f68d9ef567e5dec46cbef4530d7b77766b2706be60
Contents?: true
Size: 572 Bytes
Versions: 33
Compression:
Stored size: 572 Bytes
Contents
require 'test_helper' class ThreadSafetyTest < ActionController::TestCase should "be thread safe" do blocked = true slow_thread = Thread.new do controller = TestController.new controller.send :set_whodunnit begin sleep 0.001 end while blocked PaperTrail.whodunnit end fast_thread = Thread.new do controller = TestController.new controller.send :set_whodunnit who = PaperTrail.whodunnit blocked = false who end assert_not_equal slow_thread.value, fast_thread.value end end
Version data entries
33 entries across 33 versions & 2 rubygems