aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorNick Howard <ndh@baroquebobcat.com>2013-08-19 12:39:40 -0600
committerNick Howard <ndh@baroquebobcat.com>2013-08-19 12:39:40 -0600
commitdfb923e6e52d1fed768672b5b7e6277a599f136a (patch)
tree569fcad510dfd2e3efae0e4b849eb3c89ee2cb1d /activesupport/test
parent55360ddf7fd5f3fedc327476bf07aac3ba698e0d (diff)
downloadrails-dfb923e6e52d1fed768672b5b7e6277a599f136a.tar.gz
rails-dfb923e6e52d1fed768672b5b7e6277a599f136a.tar.bz2
rails-dfb923e6e52d1fed768672b5b7e6277a599f136a.zip
ensure freeze on Thread freezes locals
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/core_ext/thread_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/thread_test.rb b/activesupport/test/core_ext/thread_test.rb
index 230c1203ad..cf1b48d511 100644
--- a/activesupport/test/core_ext/thread_test.rb
+++ b/activesupport/test/core_ext/thread_test.rb
@@ -63,6 +63,15 @@ class ThreadExt < ActiveSupport::TestCase
end
end
+ def test_thread_variable_frozen_after_set
+ t = Thread.new { }.join
+ t.thread_variable_set :foo, "bar"
+ t.freeze
+ assert_raises(RuntimeError) do
+ t.thread_variable_set(:baz, "qux")
+ end
+ end
+
def test_thread_variable_security
t = Thread.new { sleep }