Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: dde2113867
Fetching contributors…

Cannot retrieve contributors at this time

42 lines (37 sloc) 1.105 kb
require "cases/helper"
module ActiveRecord
class Base
class ConnectionSpecification
class ResolverTest < ActiveRecord::TestCase
def resolve(spec)
Resolver.new(spec, ActiveRecord::Base, {}).spec.config
end
def test_url_host_no_db
spec = resolve 'postgres://foo?encoding=utf8'
assert_equal({
:adapter => "postgresql",
:database => "",
:host => "foo",
:encoding => "utf8" }, spec)
end
def test_url_host_db
spec = resolve 'postgres://foo/bar?encoding=utf8'
assert_equal({
:adapter => "postgresql",
:database => "bar",
:host => "foo",
:encoding => "utf8" }, spec)
end
def test_url_port
spec = resolve 'postgres://foo:123?encoding=utf8'
assert_equal({
:adapter => "postgresql",
:database => "",
:port => 123,
:host => "foo",
:encoding => "utf8" }, spec)
end
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.