From 09765829d38e78c0d260aac805c9f405a1523d56 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Tue, 23 Mar 2010 12:05:35 -0700 Subject: Cleanup the spec helper and spec rake task a bit --- spec/support/connections/mysql_connection.rb | 6 ++---- spec/support/connections/oracle_connection.rb | 8 +++----- spec/support/connections/postgresql_connection.rb | 6 ++---- spec/support/connections/sqlite3_connection.rb | 4 +--- 4 files changed, 8 insertions(+), 16 deletions(-) (limited to 'spec/support') diff --git a/spec/support/connections/mysql_connection.rb b/spec/support/connections/mysql_connection.rb index 66a53b5037..de9d05c2ce 100644 --- a/spec/support/connections/mysql_connection.rb +++ b/spec/support/connections/mysql_connection.rb @@ -2,7 +2,7 @@ puts "Using native MySQL" require "active_record" require 'logger' -ActiveRecord::Base.logger = Logger.new("debug.log") +ENV['ADAPTER'] = 'mysql' ActiveRecord::Base.configurations = { 'unit' => { @@ -11,6 +11,4 @@ ActiveRecord::Base.configurations = { :encoding => 'utf8', :database => 'arel_unit', } -} - -ActiveRecord::Base.establish_connection 'unit' +} \ No newline at end of file diff --git a/spec/support/connections/oracle_connection.rb b/spec/support/connections/oracle_connection.rb index 05be04e410..c28602b134 100644 --- a/spec/support/connections/oracle_connection.rb +++ b/spec/support/connections/oracle_connection.rb @@ -2,11 +2,11 @@ puts "Using native Oracle" require "active_record" require 'logger' +ENV['ADAPTER'] = 'oracle' + # Prepend oracle_enhanced local development directory in front of load path $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../../../oracle-enhanced/lib" -ActiveRecord::Base.logger = Logger.new("debug.log") - ActiveRecord::Base.configurations = { 'unit' => { :adapter => 'oracle_enhanced', @@ -14,6 +14,4 @@ ActiveRecord::Base.configurations = { :password => 'arel_unit', :database => 'orcl', } -} - -ActiveRecord::Base.establish_connection 'unit' +} \ No newline at end of file diff --git a/spec/support/connections/postgresql_connection.rb b/spec/support/connections/postgresql_connection.rb index 0fb6dfe065..34d304efa9 100644 --- a/spec/support/connections/postgresql_connection.rb +++ b/spec/support/connections/postgresql_connection.rb @@ -2,7 +2,7 @@ puts "Using native PostgreSQL" require "active_record" require 'logger' -ActiveRecord::Base.logger = Logger.new("debug.log") +ENV['ADAPTER'] = 'postgresql' ActiveRecord::Base.configurations = { 'unit' => { @@ -10,6 +10,4 @@ ActiveRecord::Base.configurations = { :encoding => 'utf8', :database => 'arel_unit', } -} - -ActiveRecord::Base.establish_connection 'unit' +} \ No newline at end of file diff --git a/spec/support/connections/sqlite3_connection.rb b/spec/support/connections/sqlite3_connection.rb index abdbd24fe4..4c8627c795 100644 --- a/spec/support/connections/sqlite3_connection.rb +++ b/spec/support/connections/sqlite3_connection.rb @@ -2,7 +2,7 @@ puts "Using native SQLite3" require "active_record" require 'logger' -ActiveRecord::Base.logger = Logger.new("debug.log") +ENV['ADAPTER'] = 'sqlite3' db_file = "spec/support/fixtures/fixture_database.sqlite3" @@ -22,5 +22,3 @@ unless File.exist?(db_file) puts "Executing '#{sqlite_command}'" raise "Seems that there is no sqlite3 executable available" unless system(sqlite_command) end - -ActiveRecord::Base.establish_connection("unit") -- cgit v1.2.3