From 4267db8ed6e68a703858fcdc2defe95bee83156d Mon Sep 17 00:00:00 2001 From: Andrew White Date: Thu, 3 Nov 2016 11:47:08 +0000 Subject: Flushing all logs fixed in Ruby 2.3 Previously, flushing all logs in Ruby 2.0 and later would raise an exception when there was no DATABASE_URL or database.yml. Whatever was the cause of that seems to have been fixed in Ruby 2.3. --- railties/test/application/initializers/active_record_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'railties/test') diff --git a/railties/test/application/initializers/active_record_test.rb b/railties/test/application/initializers/active_record_test.rb index b62943a278..d823577a3d 100644 --- a/railties/test/application/initializers/active_record_test.rb +++ b/railties/test/application/initializers/active_record_test.rb @@ -25,8 +25,8 @@ module ApplicationTests # 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' + # However, regardless, the server blew up. This appears to be fixed in 2.3.0. + if RUBY_VERSION >= '2.0.0' && RUBY_VERSION < '2.3.0' assert_raises (Errno::ENOENT) { get '/foo' } else get '/foo' -- cgit v1.2.3 From 9b103311d5d266fa509f5da8825ea5daecba1836 Mon Sep 17 00:00:00 2001 From: Andrew White Date: Fri, 4 Nov 2016 09:38:01 +0000 Subject: Allow time for reloading to happen Sometimes the modification time hasn't changed so the reloader doesn't pick up the changed files. This is especially true when booting the app and then modifying files. --- railties/test/application/routing_test.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'railties/test') diff --git a/railties/test/application/routing_test.rb b/railties/test/application/routing_test.rb index 7d6033c54c..c0dba3ea3e 100644 --- a/railties/test/application/routing_test.rb +++ b/railties/test/application/routing_test.rb @@ -9,6 +9,8 @@ module ApplicationTests def setup build_app boot_rails + + sleep 1 end def teardown @@ -191,14 +193,14 @@ module ApplicationTests get '/foo' assert_equal 'bar', last_response.body + sleep 1 + app_file 'config/routes.rb', <<-RUBY AppTemplate::Application.routes.draw do match 'foo', :to => 'foo#baz' end RUBY - sleep 0.1 - get '/foo' assert_equal expected, last_response.body end -- cgit v1.2.3