diff options
author | sorah <sorah@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-03-13 07:14:07 +0000 |
---|---|---|
committer | sorah <sorah@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-03-13 07:14:07 +0000 |
commit | 6ef956ab90315f63d103bed0c3a7d9d2c0028019 (patch) | |
tree | 2e1c772b2e955c14abbb453618f504bd588d43fb /test/test_pstore.rb | |
parent | f085a0b034484a621220bbaa66b3e8f61f2f870f (diff) |
* 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/trunk@31101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/test_pstore.rb')
-rw-r--r-- | test/test_pstore.rb | 10 |
1 files changed, 10 insertions, 0 deletions
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 |