aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapters/postgresql/connection_test.rb
diff options
context:
space:
mode:
authorGuo Xiang Tan <tgx_world@hotmail.com>2014-04-01 22:04:10 -0700
committerGuo Xiang Tan <tgx_world@hotmail.com>2014-04-03 01:06:43 -0700
commitf1169d9d2509189a16f7b03fee5c76b9d023a347 (patch)
treeccab4bb3499174accf6af54ee68ac7ff654415f3 /activerecord/test/cases/adapters/postgresql/connection_test.rb
parent79f06a91345a301e1a2f2378552b5860a493b256 (diff)
downloadrails-f1169d9d2509189a16f7b03fee5c76b9d023a347.tar.gz
rails-f1169d9d2509189a16f7b03fee5c76b9d023a347.tar.bz2
rails-f1169d9d2509189a16f7b03fee5c76b9d023a347.zip
Add ConnectionHelper to refactor tests.
Diffstat (limited to 'activerecord/test/cases/adapters/postgresql/connection_test.rb')
-rw-r--r--activerecord/test/cases/adapters/postgresql/connection_test.rb15
1 files changed, 3 insertions, 12 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/connection_test.rb b/activerecord/test/cases/adapters/postgresql/connection_test.rb
index 514ae20e3c..5f84c893c0 100644
--- a/activerecord/test/cases/adapters/postgresql/connection_test.rb
+++ b/activerecord/test/cases/adapters/postgresql/connection_test.rb
@@ -1,7 +1,10 @@
require "cases/helper"
+require 'support/connection_helper'
module ActiveRecord
class PostgresqlConnectionTest < ActiveRecord::TestCase
+ include ConnectionHelper
+
class NonExistentTable < ActiveRecord::Base
end
@@ -198,17 +201,5 @@ module ActiveRecord
ActiveRecord::Base.establish_connection(orig_connection.deep_merge({:variables => {:debug_print_plan => :default}}))
end
end
-
- private
-
- def run_without_connection
- original_connection = ActiveRecord::Base.remove_connection
- begin
- yield original_connection
- ensure
- ActiveRecord::Base.establish_connection(original_connection)
- end
- end
-
end
end