From 044f9ab7a4d6646ddce4560bb83b58cdc0baa751 Mon Sep 17 00:00:00 2001 From: eileencodes Date: Thu, 12 Mar 2015 08:23:43 -0400 Subject: Use `def setup` instead of `setup do` `setup do` creates unnecessary allocations of proc objects in callbacks. This prevents that from happening and results in faster code. --- railties/lib/rails/test_help.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'railties/lib/rails') diff --git a/railties/lib/rails/test_help.rb b/railties/lib/rails/test_help.rb index 40a1915b54..8953e5fd48 100644 --- a/railties/lib/rails/test_help.rb +++ b/railties/lib/rails/test_help.rb @@ -32,13 +32,15 @@ if defined?(ActiveRecord::Base) end class ActionController::TestCase - setup do + def setup @routes = Rails.application.routes + super end end class ActionDispatch::IntegrationTest - setup do + def setup @routes = Rails.application.routes + super end end -- cgit v1.2.3