From 0d7ca947272e4eff0c0447c5760d1b53167b685b Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 20 Dec 2011 14:03:45 -0600 Subject: [PATCH] skip hstore tests on PG databases that do not have hstore --- .../test/cases/adapters/postgresql/hstore_test.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/activerecord/test/cases/adapters/postgresql/hstore_test.rb b/activerecord/test/cases/adapters/postgresql/hstore_test.rb index b350094cc7..33bf4478cc 100644 --- a/activerecord/test/cases/adapters/postgresql/hstore_test.rb +++ b/activerecord/test/cases/adapters/postgresql/hstore_test.rb @@ -7,8 +7,14 @@ class PostgresqlHstoreTest < ActiveRecord::TestCase def setup @connection = ActiveRecord::Base.connection - @connection.create_table('hstores') do |t| - t.hstore 'tags' + begin + @connection.transaction do + @connection.create_table('hstores') do |t| + t.hstore 'tags' + end + end + rescue ActiveRecord::StatementInvalid + return skip "do not test on PG without hstore" end end