aboutsummaryrefslogtreecommitdiffstats
path: root/spec/support
diff options
context:
space:
mode:
authorCarl Lerche <carllerche@mac.com>2010-03-23 12:05:35 -0700
committerCarl Lerche <carllerche@mac.com>2010-03-23 12:05:35 -0700
commit09765829d38e78c0d260aac805c9f405a1523d56 (patch)
treee190d2bbca28e43b67510e0fdb912ab39606b268 /spec/support
parent195cc1402284d0e965cd96e572514fe2ff300788 (diff)
downloadrails-09765829d38e78c0d260aac805c9f405a1523d56.tar.gz
rails-09765829d38e78c0d260aac805c9f405a1523d56.tar.bz2
rails-09765829d38e78c0d260aac805c9f405a1523d56.zip
Cleanup the spec helper and spec rake task a bit
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/connections/mysql_connection.rb6
-rw-r--r--spec/support/connections/oracle_connection.rb8
-rw-r--r--spec/support/connections/postgresql_connection.rb6
-rw-r--r--spec/support/connections/sqlite3_connection.rb4
4 files changed, 8 insertions, 16 deletions
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")