diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2012-05-06 21:38:34 -0700 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2012-05-06 21:38:34 -0700 |
commit | d98bbdee14384ff2e99e2f1716a8dff681521dea (patch) | |
tree | 9cefe0fbe090f8a8bda7f553c486da9d16cb58e1 /railties | |
parent | 055857841ad53fcc1ccd20756f085690bd221646 (diff) | |
download | rails-d98bbdee14384ff2e99e2f1716a8dff681521dea.tar.gz rails-d98bbdee14384ff2e99e2f1716a8dff681521dea.tar.bz2 rails-d98bbdee14384ff2e99e2f1716a8dff681521dea.zip |
Fix build
Diffstat (limited to 'railties')
-rw-r--r-- | railties/test/commands/dbconsole_test.rb | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/railties/test/commands/dbconsole_test.rb b/railties/test/commands/dbconsole_test.rb index 5ef7ceef3b..85a7edfacd 100644 --- a/railties/test/commands/dbconsole_test.rb +++ b/railties/test/commands/dbconsole_test.rb @@ -14,30 +14,33 @@ class Rails::DBConsoleTest < ActiveSupport::TestCase assert aborted assert_match /No database is configured for the environment '\w+'/, output - app_config(development: "with_init") + app_config(test: "with_init") assert_equal Rails::DBConsole.config, "with_init" - app_db_file("development:\n without_init") + app_db_file("test:\n without_init") assert_equal Rails::DBConsole.config, "without_init" - app_db_file("development:\n <%= Rails.something_app_specific %>") + app_db_file("test:\n <%= Rails.something_app_specific %>") assert_equal Rails::DBConsole.config, "with_init" - app_db_file("development:\n\ninvalid") + app_db_file("test:\n\ninvalid") assert_equal Rails::DBConsole.config, "with_init" end def test_env - assert_equal Rails::DBConsole.env, "development" + assert_equal Rails::DBConsole.env, "test" Rails.stubs(:respond_to?).with(:env).returns(false) - assert_equal Rails::DBConsole.env, "development" + assert_equal Rails::DBConsole.env, "test" + ENV['RAILS_ENV'] = nil ENV['RACK_ENV'] = "rack_env" assert_equal Rails::DBConsole.env, "rack_env" ENV['RAILS_ENV'] = "rails_env" assert_equal Rails::DBConsole.env, "rails_env" + ensure + ENV['RAILS_ENV'] = "test" end def test_mysql @@ -138,7 +141,7 @@ class Rails::DBConsoleTest < ActiveSupport::TestCase def capture_abort @aborted = false - @output = capture(:stderr) do + @output = capture(:stderr) do begin yield rescue SystemExit |