diff options
author | schneems <richard.schneeman@gmail.com> | 2013-12-22 00:41:04 -0500 |
---|---|---|
committer | schneems <richard.schneeman@gmail.com> | 2013-12-22 00:56:59 -0500 |
commit | dd93a5f4598b420710fb4a9a2628abfd98799fb6 (patch) | |
tree | 3a0ccd5993217f01cb21fef58ef66cfaadaeb546 | |
parent | a1f9ae5eb8b3ff6fd2f55f6518d220de1838e74f (diff) | |
download | rails-dd93a5f4598b420710fb4a9a2628abfd98799fb6.tar.gz rails-dd93a5f4598b420710fb4a9a2628abfd98799fb6.tar.bz2 rails-dd93a5f4598b420710fb4a9a2628abfd98799fb6.zip |
Use Full path to sqlite database in tests
-rw-r--r-- | railties/test/application/initializers/frameworks_test.rb | 2 | ||||
-rw-r--r-- | railties/test/application/rake/dbs_test.rb | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/railties/test/application/initializers/frameworks_test.rb b/railties/test/application/initializers/frameworks_test.rb index 83104acf3c..3601a58f67 100644 --- a/railties/test/application/initializers/frameworks_test.rb +++ b/railties/test/application/initializers/frameworks_test.rb @@ -216,7 +216,7 @@ module ApplicationTests require "#{app_path}/config/environment" orig_database_url = ENV.delete("DATABASE_URL") orig_rails_env, Rails.env = Rails.env, 'development' - database_url_db_name = "db/database_url_db.sqlite3" + database_url_db_name = File.join(app_path, "db/database_url_db.sqlite3") ENV["DATABASE_URL"] = "sqlite3://:@localhost/#{database_url_db_name}" ActiveRecord::Base.establish_connection assert ActiveRecord::Base.connection diff --git a/railties/test/application/rake/dbs_test.rb b/railties/test/application/rake/dbs_test.rb index 4d348c6b4b..f5759d05fd 100644 --- a/railties/test/application/rake/dbs_test.rb +++ b/railties/test/application/rake/dbs_test.rb @@ -16,11 +16,11 @@ module ApplicationTests end def database_url_db_name - "db/database_url_db.sqlite3" + File.join(app_path, "db/database_url_db.sqlite3") end def set_database_url - ENV['DATABASE_URL'] = "sqlite3://:@localhost/#{database_url_db_name}" + ENV['DATABASE_URL'] = File.join("sqlite3://:@localhost", database_url_db_name) # ensure it's using the DATABASE_URL FileUtils.rm_rf("#{app_path}/config/database.yml") end @@ -60,7 +60,7 @@ module ApplicationTests `rails generate model book title:string; bundle exec rake db:migrate` output = `bundle exec rake db:migrate:status` - assert_match(/database:\s+\S+#{expected[:database]}/, output) + assert_match(%r{database:\s+\S*#{Regexp.escape(expected[:database])}}, output) assert_match(/up\s+\d{14}\s+Create books/, output) end end |