aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/connection_specification/resolver_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/cases/connection_specification/resolver_test.rb')
-rw-r--r--activerecord/test/cases/connection_specification/resolver_test.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/activerecord/test/cases/connection_specification/resolver_test.rb b/activerecord/test/cases/connection_specification/resolver_test.rb
index 528de07eab..8d3813b47f 100644
--- a/activerecord/test/cases/connection_specification/resolver_test.rb
+++ b/activerecord/test/cases/connection_specification/resolver_test.rb
@@ -4,8 +4,8 @@ module ActiveRecord
module ConnectionAdapters
class ConnectionSpecification
class ResolverTest < ActiveRecord::TestCase
- def resolve(spec)
- Resolver.new(spec, {}).spec.config
+ def resolve(spec, config={})
+ Resolver.new(config).resolve(spec).config
end
def test_url_invalid_adapter
@@ -17,6 +17,14 @@ module ActiveRecord
# The abstract adapter is used simply to bypass the bit of code that
# checks that the adapter file can be required in.
+ def test_url_from_environment
+ spec = resolve :production, 'production' => 'abstract://foo?encoding=utf8'
+ assert_equal({
+ adapter: "abstract",
+ host: "foo",
+ encoding: "utf8" }, spec)
+ end
+
def test_url_host_no_db
spec = resolve 'abstract://foo?encoding=utf8'
assert_equal({