Sha256: bbaab04d9d991a560f6d64c9437f66e8bf16d984db55dc97ec4ca9ec94d35072
Contents?: true
Size: 1.48 KB
Versions: 1
Compression:
Stored size: 1.48 KB
Contents
require 'test_helper' class ForcedTest < FourthBase::TestCase setup do run_db :create run_db :migrate establish_connection end def test_shared_pool assert_equal FourthBase::Base.connection_pool.object_id, CommentForced.connection_pool.object_id end def test_shared_connection assert_equal FourthBase::Base.connection.raw_connection.object_id, CommentForced.connection.raw_connection.object_id end def test_shared_new_connection_in_a_different_thread current_base_connection_id = FourthBase::Base.connection.raw_connection.object_id new_base_connection_id, new_forced_connection_id = Thread.new { [ FourthBase::Base.connection.raw_connection.object_id, CommentForced.connection.raw_connection.object_id ] }.value refute_equal new_base_connection_id, current_base_connection_id assert_equal new_base_connection_id, new_forced_connection_id end def test_shared_connected_query assert FourthBase::Base.connected? assert CommentForced.connected? CommentForced.clear_all_connections! refute FourthBase::Base.connected? refute CommentForced.connected? end def test_can_remove_connection_properly base_connection = FourthBase::Base.connection forced_connection = CommentForced.connection assert base_connection.active? assert forced_connection.active? CommentForced.remove_connection refute base_connection.active? refute forced_connection.active? end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
fourthbase-2.1.2 | test/cases/forced_test.rb |