Methods
R
S
T
Instance Public methods
resolve(spec, config={})
# File activerecord/test/cases/connection_specification/resolver_test.rb, line 7
def resolve(spec, config={})
  Resolver.new(config).resolve(spec)
end
spec(spec, config={})
# File activerecord/test/cases/connection_specification/resolver_test.rb, line 11
def spec(spec, config={})
  Resolver.new(config).spec(spec)
end
test_encoded_password()
# 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()
# File activerecord/test/cases/connection_specification/resolver_test.rb, line 90
def test_url_absolute_path_for_sqlite3
  spec = resolve 'sqlite3:/foo_test'
  assert_equal('/foo_test', spec["database"])
end
test_url_from_environment()

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()
# File activerecord/test/cases/connection_specification/resolver_test.rb, line 60
def test_url_host_db
  spec = resolve 'abstract://foo/bar?encoding=utf8'
  assert_equal({
    "adapter"  => "abstract",
    "database" => "bar",
    "host"     => "foo",
    "encoding" => "utf8" }, spec)
end
test_url_host_no_db()
# File activerecord/test/cases/connection_specification/resolver_test.rb, line 52
def test_url_host_no_db
  spec = resolve 'abstract://foo?encoding=utf8'
  assert_equal({
    "adapter"  => "abstract",
    "host"     => "foo",
    "encoding" => "utf8" }, spec)
end
test_url_invalid_adapter()
# 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()
# File activerecord/test/cases/connection_specification/resolver_test.rb, line 100
def test_url_memory_db_for_sqlite3
  spec = resolve 'sqlite3::memory:'
  assert_equal(':memory:', spec["database"])
end
test_url_port()
# File activerecord/test/cases/connection_specification/resolver_test.rb, line 69
def test_url_port
  spec = resolve 'abstract://foo:123?encoding=utf8'
  assert_equal({
    "adapter"  => "abstract",
    "port"     => 123,
    "host"     => "foo",
    "encoding" => "utf8" }, spec)
end
test_url_relative_path_for_sqlite3()
# File activerecord/test/cases/connection_specification/resolver_test.rb, line 95
def test_url_relative_path_for_sqlite3
  spec = resolve 'sqlite3:foo_test'
  assert_equal('foo_test', spec["database"])
end
test_url_sub_key()
# 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()
# 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()
# 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
test_url_with_authority_for_sqlite3()
# File activerecord/test/cases/connection_specification/resolver_test.rb, line 85
def test_url_with_authority_for_sqlite3
  spec = resolve 'sqlite3:///foo_test'
  assert_equal('/foo_test', spec["database"])
end