Sha256: 038430788bde329d227693903968c84ba9d7f2df4d89b9e62965bbb7e1fe9dea
Contents?: true
Size: 790 Bytes
Versions: 12
Compression:
Stored size: 790 Bytes
Contents
# encoding: utf-8 require 'helper' class TlsTest < Test::Unit::TestCase thread_local_attribute :tester thread_local_attribute :dynamic do "dynamic" end thread_local_attribute :dynamic2 do "dynamic2" end def test_get_and_set assert_equal(nil, TlsTest.tester) TlsTest.tester = 1 assert_equal(1, TlsTest.tester) assert_equal("dynamic", TlsTest.dynamic) end def test_thread_locality Thread.new { assert_equal(nil, TlsTest.tester) TlsTest.tester = 1 assert_equal(1, TlsTest.tester) assert_equal("dynamic", TlsTest.dynamic) }.join Thread.new { assert_equal(nil, TlsTest.tester) TlsTest.tester = 1 assert_equal(1, TlsTest.tester) assert_equal("dynamic", TlsTest.dynamic) }.join end end
Version data entries
12 entries across 12 versions & 2 rubygems