diff options
Diffstat (limited to 'spec/support')
-rw-r--r-- | spec/support/connections/mysql_connection.rb | 6 | ||||
-rw-r--r-- | spec/support/connections/oracle_connection.rb | 8 | ||||
-rw-r--r-- | spec/support/connections/postgresql_connection.rb | 6 | ||||
-rw-r--r-- | spec/support/connections/sqlite3_connection.rb | 4 |
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") |