提交 e2fdfa9c 编写于 作者: J Justin George

improve tests to check for existence of extensions method, and skip testing...

improve tests to check for existence of extensions method, and skip testing dumped extensions if they are unsupported by the database
上级 c0990f04
...@@ -36,6 +36,7 @@ def teardown ...@@ -36,6 +36,7 @@ def teardown
end end
def test_hstore_included_in_extensions def test_hstore_included_in_extensions
assert @connection.respond_to?(:extensions), "connection should have a list of extensions"
assert @connection.extensions.include?('hstore'), "extension list should include hstore" assert @connection.extensions.include?('hstore'), "extension list should include hstore"
end end
......
...@@ -231,16 +231,15 @@ def test_schema_dump_includes_decimal_options ...@@ -231,16 +231,15 @@ def test_schema_dump_includes_decimal_options
end end
if current_adapter?(:PostgreSQLAdapter) if current_adapter?(:PostgreSQLAdapter)
if ActiveRecord::Base.connection.supports_extensions?
def test_schema_dump_includes_extensions def test_schema_dump_includes_extensions
connection = ActiveRecord::Base.connection connection = ActiveRecord::Base.connection
return skip unless connection.supports_extensions?
unless connection.extension_enabled?('hstore') unless connection.extension_enabled?('hstore')
connection.enable_extension 'hstore' connection.enable_extension 'hstore'
end end
output = standard_dump output = standard_dump
assert_match %r{enable_extension "hstore"}, output assert_match %r{enable_extension "hstore"}, output
end end
end
def test_schema_dump_includes_xml_shorthand_definition def test_schema_dump_includes_xml_shorthand_definition
output = standard_dump output = standard_dump
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册