diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-02-24 15:12:13 -0800 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-02-24 15:12:13 -0800 |
commit | e9d659224bb6610d726bd333a9425b4f8f5796ba (patch) | |
tree | 53896b07fb022135d19377a7f2f38aaf22ef4fcc /railties/test/application/initializers/active_record_test.rb | |
parent | 2647a3cabfb88ac0dac318207bf611b0b66d495f (diff) | |
parent | 2a12a04a54590d3a5f2abf4cd4eff3a7b1ee6ef4 (diff) | |
download | rails-e9d659224bb6610d726bd333a9425b4f8f5796ba.tar.gz rails-e9d659224bb6610d726bd333a9425b4f8f5796ba.tar.bz2 rails-e9d659224bb6610d726bd333a9425b4f8f5796ba.zip |
Merge pull request #9406 from rails/3-2-stable-ruby-2
Rails 3.2.x is now compatible with Ruby 2.0.0
Diffstat (limited to 'railties/test/application/initializers/active_record_test.rb')
-rw-r--r-- | railties/test/application/initializers/active_record_test.rb | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/railties/test/application/initializers/active_record_test.rb b/railties/test/application/initializers/active_record_test.rb index edf78a8a0a..b62943a278 100644 --- a/railties/test/application/initializers/active_record_test.rb +++ b/railties/test/application/initializers/active_record_test.rb @@ -23,10 +23,17 @@ module ApplicationTests boot_rails simple_controller - get '/foo' - assert last_response.body.include?("We're sorry, but something went wrong (500)") + # ActiveSupport::LogSubscriber.flush_all! in lib/rails/rack/logger.rb blew up in Ruby 2.0 + # because it tries to open the database. This behavior doesn't happen in Ruby 1.9.3. + # However, regardless, the server blew up. + if RUBY_VERSION >= '2.0.0' + assert_raises (Errno::ENOENT) { get '/foo' } + else + get '/foo' + assert last_response.body.include?("We're sorry, but something went wrong (500)") + end end - + test "uses DATABASE_URL env var when config/database.yml doesn't exist" do database_path = "/db/foo.sqlite3" FileUtils.rm_rf("#{app_path}/config/database.yml") @@ -35,7 +42,7 @@ module ApplicationTests get '/foo' assert_equal 'foo', last_response.body - + # clean up FileUtils.rm("#{app_path}/#{database_path}") end |