1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Use a git-ignored database.yml file for test DB configuration

This commit is contained in:
Bryan Helmkamp 2008-04-12 18:36:43 -04:00
parent 3967bd524d
commit 8feaf2b8bd
3 changed files with 10 additions and 9 deletions

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
coverage/*
config/database.yml
*.DS_Store

View file

@ -0,0 +1,6 @@
test:
adapter: mysql
username: root
password: password
encoding: utf8
database: sql_algebra_test

View file

@ -6,15 +6,9 @@ $LOAD_PATH.unshift "#{dir}/../lib"
Dir["#{dir}/matchers/*"].each { |m| require "#{dir}/matchers/#{File.basename(m)}" }
require 'active_relation'
ActiveRecord::Base.configurations = {
'test' => {
:adapter => 'mysql',
:username => 'root',
:password => 'password',
:encoding => 'utf8',
:database => 'sql_algebra_test',
},
}
FileUtils.cp("#{dir}/../config/database.yml.example", "#{dir}/../config/database.yml") unless File.exist?("#{dir}/../config/database.yml")
ActiveRecord::Base.configurations = YAML::load(IO.read("#{dir}/../config/database.yml"))
ActiveRecord::Base.establish_connection 'test'
class Hash