Permalink
Browse files

Combine tests and restore columns dropped by hstore testing

Disabling the hstore extension during testing created order dependent
test failures.
  • Loading branch information...
1 parent 7748d64 commit 524ce560ffc6b696acb780f7fe8474f552d5f795 @MacksMind MacksMind committed Mar 22, 2013
Showing with 5 additions and 15 deletions.
  1. +5 −15 activerecord/test/cases/adapters/postgresql/hstore_test.rb
@@ -40,25 +40,15 @@ def test_hstore_included_in_extensions
assert @connection.extensions.include?('hstore'), "extension list should include hstore"
end
- def test_hstore_enabled
+ def test_disable_enable_hstore
assert @connection.extension_enabled?('hstore')
- end
-
- def test_disable_hstore
- if @connection.extension_enabled?('hstore')
- @connection.disable_extension 'hstore'
- assert_not @connection.extension_enabled?('hstore')
- end
- end
-
- def test_enable_hstore
- if @connection.extension_enabled?('hstore')
- @connection.disable_extension 'hstore'
- end
-
+ @connection.disable_extension 'hstore'
assert_not @connection.extension_enabled?('hstore')
@connection.enable_extension 'hstore'
assert @connection.extension_enabled?('hstore')
+ ensure
+ # Restore column(s) dropped by `drop extension hstore cascade;`
+ load_schema
end
def test_column

0 comments on commit 524ce56

Please sign in to comment.