1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

improve tests to check for existence of extensions method, and skip testing dumped extensions if they are unsupported by the database

This commit is contained in:
Justin George 2013-02-06 15:55:58 -08:00
parent c0990f040f
commit e2fdfa9c07
2 changed files with 8 additions and 8 deletions

View file

@ -36,6 +36,7 @@ class PostgresqlHstoreTest < ActiveRecord::TestCase
end
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"
end

View file

@ -231,15 +231,14 @@ class SchemaDumperTest < ActiveRecord::TestCase
end
if current_adapter?(:PostgreSQLAdapter)
if ActiveRecord::Base.connection.supports_extensions?
def test_schema_dump_includes_extensions
connection = ActiveRecord::Base.connection
unless connection.extension_enabled?('hstore')
connection.enable_extension 'hstore'
end
output = standard_dump
assert_match %r{enable_extension "hstore"}, output
def test_schema_dump_includes_extensions
connection = ActiveRecord::Base.connection
return skip unless connection.supports_extensions?
unless connection.extension_enabled?('hstore')
connection.enable_extension 'hstore'
end
output = standard_dump
assert_match %r{enable_extension "hstore"}, output
end
def test_schema_dump_includes_xml_shorthand_definition