diff options
author | Mack Earnhardt <mack@agilereasoning.com> | 2013-03-22 11:07:21 -0400 |
---|---|---|
committer | Mack Earnhardt <mack@agilereasoning.com> | 2013-03-26 16:15:07 -0400 |
commit | 524ce560ffc6b696acb780f7fe8474f552d5f795 (patch) | |
tree | 191ad0c940554b8f95f0f7151af471de4c7f60c7 /activerecord | |
parent | 7748d64a76ae140cb80cd54d183bc1f94c192b9d (diff) | |
download | rails-524ce560ffc6b696acb780f7fe8474f552d5f795.tar.gz rails-524ce560ffc6b696acb780f7fe8474f552d5f795.tar.bz2 rails-524ce560ffc6b696acb780f7fe8474f552d5f795.zip |
Combine tests and restore columns dropped by hstore testing
Disabling the hstore extension during testing created order dependent
test failures.
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/adapters/postgresql/hstore_test.rb | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/hstore_test.rb b/activerecord/test/cases/adapters/postgresql/hstore_test.rb index ad98d7c8ce..060b92028d 100644 --- a/activerecord/test/cases/adapters/postgresql/hstore_test.rb +++ b/activerecord/test/cases/adapters/postgresql/hstore_test.rb @@ -40,25 +40,15 @@ class PostgresqlHstoreTest < ActiveRecord::TestCase 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 |