aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-03-06 14:18:27 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-03-06 14:18:27 +0000
commit10a86b21fbf702b5382dbc95953d935b91ae2c41 (patch)
treed181da702ca8a1f0daf441ad27a1b3e05ec4ca18
parent688f0f6712a37474e92f86de1046f5aa0e11030e (diff)
downloadrails-10a86b21fbf702b5382dbc95953d935b91ae2c41.tar.gz
rails-10a86b21fbf702b5382dbc95953d935b91ae2c41.tar.bz2
rails-10a86b21fbf702b5382dbc95953d935b91ae2c41.zip
Allow unit tests to run on a remote server for PostgreSQL #781 [adamm@galacticasoftware.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@856 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r--railties/CHANGELOG2
-rwxr-xr-xrailties/fresh_rakefile8
2 files changed, 6 insertions, 4 deletions
diff --git a/railties/CHANGELOG b/railties/CHANGELOG
index d61a3b3135..2a722cf97a 100644
--- a/railties/CHANGELOG
+++ b/railties/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Allow unit tests to run on a remote server for PostgreSQL #781 [adamm@galacticasoftware.com]
+
* Added web_service generator (run ./script/generate web_service for help) #776 [Leon Bredt]
* Added app/apis and components to code statistics report #729 [Scott Barron]
diff --git a/railties/fresh_rakefile b/railties/fresh_rakefile
index 394e0c3d2a..fa9abbff66 100755
--- a/railties/fresh_rakefile
+++ b/railties/fresh_rakefile
@@ -120,7 +120,7 @@ task :clone_structure_to_test => [ :db_structure_dump, :purge_test_database ] do
ActiveRecord::Base.connection.execute(table)
end
when "postgresql"
- `psql -U #{abcs["test"]["username"]} -f db/#{RAILS_ENV}_structure.sql #{abcs["test"]["database"]}`
+ `psql -U #{abcs["test"]["username"]} -h #{abcs["test"]["host"]} -f db/#{RAILS_ENV}_structure.sql #{abcs["test"]["database"]}`
when "sqlite", "sqlite3"
`#{abcs[RAILS_ENV]["adapter"]} #{abcs["test"]["dbfile"]} < db/#{RAILS_ENV}_structure.sql`
else
@@ -136,7 +136,7 @@ task :db_structure_dump => :environment do
ActiveRecord::Base.establish_connection(abcs[RAILS_ENV])
File.open("db/#{RAILS_ENV}_structure.sql", "w+") { |f| f << ActiveRecord::Base.connection.structure_dump }
when "postgresql"
- `pg_dump -U #{abcs[RAILS_ENV]["username"]} -s -f db/#{RAILS_ENV}_structure.sql #{abcs[RAILS_ENV]["database"]}`
+ `pg_dump -U #{abcs[RAILS_ENV]["username"]} -h #{abcs[RAILS_ENV]["host"]} -s -f db/#{RAILS_ENV}_structure.sql #{abcs[RAILS_ENV]["database"]}`
when "sqlite", "sqlite3"
`#{abcs[RAILS_ENV]["adapter"]} #{abcs[RAILS_ENV]["dbfile"]} .schema > db/#{RAILS_ENV}_structure.sql`
else
@@ -152,8 +152,8 @@ task :purge_test_database => :environment do
ActiveRecord::Base.establish_connection(abcs[RAILS_ENV])
ActiveRecord::Base.connection.recreate_database(abcs["test"]["database"])
when "postgresql"
- `dropdb -U #{abcs["test"]["username"]} #{abcs["test"]["database"]}`
- `createdb -U #{abcs["test"]["username"]} #{abcs["test"]["database"]}`
+ `dropdb -U #{abcs["test"]["username"]} -h #{abcs[RAILS_ENV]["host"]} #{abcs["test"]["database"]}`
+ `createdb -U #{abcs["test"]["username"]} -h #{abcs[RAILS_ENV]["host"]} #{abcs["test"]["database"]}`
when "sqlite","sqlite3"
File.delete(abcs["test"]["dbfile"]) if File.exist?(abcs["test"]["dbfile"])
else