aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2012-08-09 14:30:26 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2012-08-09 14:50:26 -0700
commit1e8c0a29d0190c375580c594479f517f4c9aa4bf (patch)
tree5840390673edc823dc244b2215af64f184bc1025 /actionpack
parent0b29c7bb7b40f66977e374667daf7239970bf635 (diff)
downloadrails-1e8c0a29d0190c375580c594479f517f4c9aa4bf.tar.gz
rails-1e8c0a29d0190c375580c594479f517f4c9aa4bf.tar.bz2
rails-1e8c0a29d0190c375580c594479f517f4c9aa4bf.zip
refactor the before_setup hooks to a module
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/test/abstract_unit.rb25
1 files changed, 12 insertions, 13 deletions
diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb
index 60bf583dfd..f7a3f9a533 100644
--- a/actionpack/test/abstract_unit.rb
+++ b/actionpack/test/abstract_unit.rb
@@ -112,6 +112,15 @@ end
SharedTestRoutes = ActionDispatch::Routing::RouteSet.new
+module ActionDispatch
+ module SharedRoutes
+ def before_setup
+ @routes = SharedTestRoutes
+ super
+ end
+ end
+end
+
module ActiveSupport
class TestCase
include SetupOnce
@@ -159,10 +168,7 @@ class BasicController
end
class ActionDispatch::IntegrationTest < ActiveSupport::TestCase
- def before_setup
- @routes = SharedTestRoutes
- super
- end
+ include ActionDispatch::SharedRoutes
def self.build_app(routes = nil)
RoutedRackApp.new(routes || ActionDispatch::Routing::RouteSet.new) do |middleware|
@@ -291,11 +297,7 @@ module ActionController
class TestCase
include ActionDispatch::TestProcess
-
- def before_setup
- @routes = SharedTestRoutes
- super
- end
+ include ActionDispatch::SharedRoutes
end
end
@@ -306,10 +308,7 @@ module ActionView
class TestCase
# Must repeat the setup because AV::TestCase is a duplication
# of AC::TestCase
- def before_setup
- @routes = SharedTestRoutes
- super
- end
+ include ActionDispatch::SharedRoutes
end
end