diff options
author | eileencodes <eileencodes@gmail.com> | 2015-03-12 08:23:43 -0400 |
---|---|---|
committer | eileencodes <eileencodes@gmail.com> | 2015-03-12 08:25:51 -0400 |
commit | 044f9ab7a4d6646ddce4560bb83b58cdc0baa751 (patch) | |
tree | 78745f34671081a7f968395fbc66ca9693641168 | |
parent | 9c655f1275c47509c0fa0f1b29ee29a009fc7066 (diff) | |
download | rails-044f9ab7a4d6646ddce4560bb83b58cdc0baa751.tar.gz rails-044f9ab7a4d6646ddce4560bb83b58cdc0baa751.tar.bz2 rails-044f9ab7a4d6646ddce4560bb83b58cdc0baa751.zip |
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.
-rw-r--r-- | railties/lib/rails/test_help.rb | 6 |
1 files changed, 4 insertions, 2 deletions
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 |