"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "activerecord/test/cases/connection_adapters/connection_handler_test.rb" between
rails-6.1.3.2.tar.gz and rails-6.1.4.tar.gz

About: Ruby on Rails is a web application development framework (written in Ruby).

connection_handler_test.rb  (rails-6.1.3.2):connection_handler_test.rb  (rails-6.1.4)
skipping to change at line 65 skipping to change at line 65
assert_equal "test/db/primary.sqlite3", pool.db_config.database assert_equal "test/db/primary.sqlite3", pool.db_config.database
assert_not_nil pool = @handler.retrieve_connection_pool("common") assert_not_nil pool = @handler.retrieve_connection_pool("common")
assert_equal "test/db/common.sqlite3", pool.db_config.database assert_equal "test/db/common.sqlite3", pool.db_config.database
ensure ensure
ActiveRecord::Base.configurations = @prev_configs ActiveRecord::Base.configurations = @prev_configs
ENV["RAILS_ENV"] = previous_env ENV["RAILS_ENV"] = previous_env
end end
unless in_memory_db? unless in_memory_db?
def test_not_setting_writing_role_while_using_another_named_role_raises
connection_handler = ActiveRecord::Base.connection_handler
ActiveRecord::Base.connection_handler = ActiveRecord::ConnectionAdapte
rs::ConnectionHandler.new
ActiveRecord::Base.connects_to(shards: { default: { all: :arunit }, on
e: { all: :arunit } })
assert_raises(ArgumentError) { setup_shared_connection_pool }
ensure
ActiveRecord::Base.connection_handler = connection_handler
ActiveRecord::Base.establish_connection :arunit
end
def test_setting_writing_role_while_using_another_named_role_does_not_ra
ise
connection_handler = ActiveRecord::Base.connection_handler
ActiveRecord::Base.connection_handler = ActiveRecord::ConnectionAdapte
rs::ConnectionHandler.new
old_role, ActiveRecord::Base.writing_role = ActiveRecord::Base.writing
_role, :all
ActiveRecord::Base.connects_to(shards: { default: { all: :arunit }, on
e: { all: :arunit } })
assert_nothing_raised { setup_shared_connection_pool }
ensure
ActiveRecord::Base.writing_role = old_role
ActiveRecord::Base.connection_handler = connection_handler
ActiveRecord::Base.establish_connection :arunit
end
def test_establish_connection_with_primary_works_without_deprecation def test_establish_connection_with_primary_works_without_deprecation
old_config = ActiveRecord::Base.configurations old_config = ActiveRecord::Base.configurations
config = { "primary" => { "adapter" => "sqlite3", "database" => "test/ db/primary.sqlite3" } } config = { "primary" => { "adapter" => "sqlite3", "database" => "test/ db/primary.sqlite3" } }
ActiveRecord::Base.configurations = config ActiveRecord::Base.configurations = config
@handler.establish_connection(:primary) @handler.establish_connection(:primary)
assert_not_deprecated do assert_not_deprecated do
@handler.retrieve_connection("primary") @handler.retrieve_connection("primary")
@handler.remove_connection_pool("primary") @handler.remove_connection_pool("primary")
 End of changes. 1 change blocks. 
0 lines changed or deleted 32 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)