Methods
- R
- S
- T
-
- test_encoded_password,
- test_url_absolute_path_for_sqlite3,
- test_url_from_environment,
- test_url_host_db,
- test_url_host_no_db,
- test_url_invalid_adapter,
- test_url_memory_db_for_sqlite3,
- test_url_port,
- test_url_relative_path_for_sqlite3,
- test_url_sub_key,
- test_url_sub_key_for_sqlite3,
- test_url_sub_key_merges_correctly,
- test_url_with_authority_for_sqlite3
Instance Public methods
resolve(spec, config={})
Link
spec(spec, config={})
Link
test_encoded_password()
Link
# File activerecord/test/cases/connection_specification/resolver_test.rb, line 78 def test_encoded_password password = 'am@z1ng_p@ssw0rd#!' encoded_password = URI.encode_www_form_component(password) spec = resolve "abstract://foo:#{encoded_password}@localhost/bar" assert_equal password, spec["password"] end
test_url_absolute_path_for_sqlite3()
Link
test_url_from_environment()
Link
The abstract adapter is used simply to bypass the bit of code that checks that the adapter file can be required in.
# File activerecord/test/cases/connection_specification/resolver_test.rb, line 26 def test_url_from_environment spec = resolve :production, 'production' => 'abstract://foo?encoding=utf8' assert_equal({ "adapter" => "abstract", "host" => "foo", "encoding" => "utf8" }, spec) end
test_url_host_db()
Link
test_url_host_no_db()
Link
test_url_invalid_adapter()
Link
# File activerecord/test/cases/connection_specification/resolver_test.rb, line 15 def test_url_invalid_adapter error = assert_raises(LoadError) do spec 'ridiculous://foo?encoding=utf8' end assert_match "Could not load 'active_record/connection_adapters/ridiculous_adapter'", error.message end
test_url_memory_db_for_sqlite3()
Link
test_url_port()
Link
test_url_relative_path_for_sqlite3()
Link
test_url_sub_key()
Link
# File activerecord/test/cases/connection_specification/resolver_test.rb, line 34 def test_url_sub_key spec = resolve :production, 'production' => {"url" => 'abstract://foo?encoding=utf8'} assert_equal({ "adapter" => "abstract", "host" => "foo", "encoding" => "utf8" }, spec) end
test_url_sub_key_for_sqlite3()
Link
# File activerecord/test/cases/connection_specification/resolver_test.rb, line 105 def test_url_sub_key_for_sqlite3 spec = resolve :production, 'production' => {"url" => 'sqlite3:foo?encoding=utf8'} assert_equal({ "adapter" => "sqlite3", "database" => "foo", "encoding" => "utf8" }, spec) end
test_url_sub_key_merges_correctly()
Link
# File activerecord/test/cases/connection_specification/resolver_test.rb, line 42 def test_url_sub_key_merges_correctly hash = {"url" => 'abstract://foo?encoding=utf8&', "adapter" => "sqlite3", "host" => "bar", "pool" => "3"} spec = resolve :production, 'production' => hash assert_equal({ "adapter" => "abstract", "host" => "foo", "encoding" => "utf8", "pool" => "3" }, spec) end