Permalink
Browse files

improve tests to check for existence of extensions method, and skip t…

…esting dumped extensions if they are unsupported by the database
  • Loading branch information...
1 parent c0990f0 commit e2fdfa9c07e1ec643dc4658a1a12075d9cc26c79 @jaggederest jaggederest committed Feb 6, 2013
@@ -36,6 +36,7 @@ def teardown
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
@@ -231,15 +231,14 @@ def test_schema_dump_includes_decimal_options
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

0 comments on commit e2fdfa9

Please sign in to comment.