diff options
author | Xavier Noria <fxn@hashref.com> | 2016-08-06 18:26:20 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2016-08-06 18:26:53 +0200 |
commit | 9617db2078e8a85c8944392c21dd748f932bbd80 (patch) | |
tree | 727d60f1d2f9bbb6510483c366f62d75e2647619 /activerecord/test/cases/connection_specification | |
parent | 4df2b779ddfcb27761c71e00e2b241bfa06a0950 (diff) | |
download | rails-9617db2078e8a85c8944392c21dd748f932bbd80.tar.gz rails-9617db2078e8a85c8944392c21dd748f932bbd80.tar.bz2 rails-9617db2078e8a85c8944392c21dd748f932bbd80.zip |
applies new string literal convention in activerecord/test
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
Diffstat (limited to 'activerecord/test/cases/connection_specification')
-rw-r--r-- | activerecord/test/cases/connection_specification/resolver_test.rb | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/activerecord/test/cases/connection_specification/resolver_test.rb b/activerecord/test/cases/connection_specification/resolver_test.rb index b30a83d9ce..7a6125d81b 100644 --- a/activerecord/test/cases/connection_specification/resolver_test.rb +++ b/activerecord/test/cases/connection_specification/resolver_test.rb @@ -14,7 +14,7 @@ module ActiveRecord def test_url_invalid_adapter error = assert_raises(LoadError) do - spec 'ridiculous://foo?encoding=utf8' + spec "ridiculous://foo?encoding=utf8" end assert_match "Could not load 'active_record/connection_adapters/ridiculous_adapter'", error.message @@ -24,7 +24,7 @@ module ActiveRecord # checks that the adapter file can be required in. def test_url_from_environment - spec = resolve :production, 'production' => 'abstract://foo?encoding=utf8' + spec = resolve :production, "production" => "abstract://foo?encoding=utf8" assert_equal({ "adapter" => "abstract", "host" => "foo", @@ -33,7 +33,7 @@ module ActiveRecord end def test_url_sub_key - spec = resolve :production, 'production' => {"url" => 'abstract://foo?encoding=utf8'} + spec = resolve :production, "production" => {"url" => "abstract://foo?encoding=utf8"} assert_equal({ "adapter" => "abstract", "host" => "foo", @@ -42,8 +42,8 @@ module ActiveRecord end def test_url_sub_key_merges_correctly - hash = {"url" => 'abstract://foo?encoding=utf8&', "adapter" => "sqlite3", "host" => "bar", "pool" => "3"} - spec = resolve :production, 'production' => hash + hash = {"url" => "abstract://foo?encoding=utf8&", "adapter" => "sqlite3", "host" => "bar", "pool" => "3"} + spec = resolve :production, "production" => hash assert_equal({ "adapter" => "abstract", "host" => "foo", @@ -53,7 +53,7 @@ module ActiveRecord end def test_url_host_no_db - spec = resolve 'abstract://foo?encoding=utf8' + spec = resolve "abstract://foo?encoding=utf8" assert_equal({ "adapter" => "abstract", "host" => "foo", @@ -61,13 +61,13 @@ module ActiveRecord end def test_url_missing_scheme - spec = resolve 'foo' + spec = resolve "foo" assert_equal({ "database" => "foo" }, spec) end def test_url_host_db - spec = resolve 'abstract://foo/bar?encoding=utf8' + spec = resolve "abstract://foo/bar?encoding=utf8" assert_equal({ "adapter" => "abstract", "database" => "bar", @@ -76,7 +76,7 @@ module ActiveRecord end def test_url_port - spec = resolve 'abstract://foo:123?encoding=utf8' + spec = resolve "abstract://foo:123?encoding=utf8" assert_equal({ "adapter" => "abstract", "port" => 123, @@ -85,34 +85,34 @@ module ActiveRecord end def test_encoded_password - password = 'am@z1ng_p@ssw0rd#!' + 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 def test_url_with_authority_for_sqlite3 - spec = resolve 'sqlite3:///foo_test' - assert_equal('/foo_test', spec["database"]) + spec = resolve "sqlite3:///foo_test" + assert_equal("/foo_test", spec["database"]) end def test_url_absolute_path_for_sqlite3 - spec = resolve 'sqlite3:/foo_test' - assert_equal('/foo_test', spec["database"]) + spec = resolve "sqlite3:/foo_test" + assert_equal("/foo_test", spec["database"]) end def test_url_relative_path_for_sqlite3 - spec = resolve 'sqlite3:foo_test' - assert_equal('foo_test', spec["database"]) + spec = resolve "sqlite3:foo_test" + assert_equal("foo_test", spec["database"]) end def test_url_memory_db_for_sqlite3 - spec = resolve 'sqlite3::memory:' - assert_equal(':memory:', spec["database"]) + spec = resolve "sqlite3::memory:" + assert_equal(":memory:", spec["database"]) end def test_url_sub_key_for_sqlite3 - spec = resolve :production, 'production' => {"url" => 'sqlite3:foo?encoding=utf8'} + spec = resolve :production, "production" => {"url" => "sqlite3:foo?encoding=utf8"} assert_equal({ "adapter" => "sqlite3", "database" => "foo", @@ -121,12 +121,12 @@ module ActiveRecord end def test_spec_name_on_key_lookup - spec = spec(:readonly, 'readonly' => {'adapter' => 'sqlite3'}) + spec = spec(:readonly, "readonly" => {"adapter" => "sqlite3"}) assert_equal "readonly", spec.name end def test_spec_name_with_inline_config - spec = spec({'adapter' => 'sqlite3'}) + spec = spec({"adapter" => "sqlite3"}) assert_equal "primary", spec.name, "should default to primary id" end end |