diff options
author | Yves Senn <yves.senn@gmail.com> | 2015-06-11 14:11:52 +0200 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2015-06-11 14:12:16 +0200 |
commit | 81ae632d08ce06834ba46a5ffc505e9128b3d1a0 (patch) | |
tree | f0761b38451ecf6d473c44ce768428a3a753ff10 /activerecord/test/cases/adapters/mysql/statement_pool_test.rb | |
parent | 54d84cbb77a7fbc6359eda4eb40cc7da29c426e1 (diff) | |
download | rails-81ae632d08ce06834ba46a5ffc505e9128b3d1a0.tar.gz rails-81ae632d08ce06834ba46a5ffc505e9128b3d1a0.tar.bz2 rails-81ae632d08ce06834ba46a5ffc505e9128b3d1a0.zip |
make it possible to run AR tests with bin/test
Diffstat (limited to 'activerecord/test/cases/adapters/mysql/statement_pool_test.rb')
-rw-r--r-- | activerecord/test/cases/adapters/mysql/statement_pool_test.rb | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/activerecord/test/cases/adapters/mysql/statement_pool_test.rb b/activerecord/test/cases/adapters/mysql/statement_pool_test.rb index 209a0cf464..6be36566de 100644 --- a/activerecord/test/cases/adapters/mysql/statement_pool_test.rb +++ b/activerecord/test/cases/adapters/mysql/statement_pool_test.rb @@ -1,23 +1,19 @@ require 'cases/helper' -module ActiveRecord::ConnectionAdapters - class MysqlAdapter - class StatementPoolTest < ActiveRecord::TestCase - if Process.respond_to?(:fork) - def test_cache_is_per_pid - cache = StatementPool.new nil, 10 - cache['foo'] = 'bar' - assert_equal 'bar', cache['foo'] +class MysqlStatementPoolTest < ActiveRecord::MysqlTestCase + if Process.respond_to?(:fork) + def test_cache_is_per_pid + cache = ActiveRecord::ConnectionAdapters::MysqlAdapter::StatementPool.new nil, 10 + cache['foo'] = 'bar' + assert_equal 'bar', cache['foo'] - pid = fork { - lookup = cache['foo']; - exit!(!lookup) - } + pid = fork { + lookup = cache['foo']; + exit!(!lookup) + } - Process.waitpid pid - assert $?.success?, 'process should exit successfully' - end - end + Process.waitpid pid + assert $?.success?, 'process should exit successfully' end end end |