From b337563fba42e8a531e6c96c98568491e2b0a7c2 Mon Sep 17 00:00:00 2001 From: yugui Date: Sat, 28 May 2011 23:32:37 +0000 Subject: merges r31101 from trunk into ruby_1_9_2. -- * lib/pstore.rb: Fix don't raise "nested transaction" when thread_safe is true. Patch by Masaki Matsushita (Glass_saga). [ruby-dev:43337] * test/test_pstore.rb: Test for above. Patch by Masaki Matsushita (Glass_saga) [ruby-dev:43337] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@31776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/test_pstore.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test') diff --git a/test/test_pstore.rb b/test/test_pstore.rb index 32d79ea2ba..b6f79251da 100644 --- a/test/test_pstore.rb +++ b/test/test_pstore.rb @@ -100,4 +100,14 @@ class PStoreTest < Test::Unit::TestCase File.unlink("pstore.tmp2.#{Process.pid}") rescue nil end end + + def test_nested_transaction_raises_error + assert_raise(PStore::Error) do + @pstore.transaction { @pstore.transaction { } } + end + pstore = PStore.new("pstore.tmp2.#{Process.pid}", true) + assert_raise(PStore::Error) do + pstore.transaction { pstore.transaction { } } + end + end end -- cgit v1.2.3