aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--actionpack/test/dispatch/mapper_test.rb23
1 files changed, 11 insertions, 12 deletions
diff --git a/actionpack/test/dispatch/mapper_test.rb b/actionpack/test/dispatch/mapper_test.rb
index 9049391930..dab15a909e 100644
--- a/actionpack/test/dispatch/mapper_test.rb
+++ b/actionpack/test/dispatch/mapper_test.rb
@@ -4,17 +4,20 @@ module ActionDispatch
module Routing
class MapperTest < ActiveSupport::TestCase
class FakeSet < ActionDispatch::Routing::RouteSet
- attr_reader :routes
- alias :set :routes
-
def initialize
- @routes = []
+ @my_routes = []
+ super
end
def resources_path_names
{}
end
+ def add_route(*args)
+ @my_routes << args
+ super
+ end
+
def request_class
ActionDispatch::Request
end
@@ -23,24 +26,20 @@ module ActionDispatch
RouteSet::Dispatcher
end
- def add_route(*args)
- routes << args
- end
-
def defaults
- routes.map { |x| x[3] }
+ @my_routes.map { |x| x[3] }
end
def conditions
- routes.map { |x| x[1] }
+ @my_routes.map { |x| x[1] }
end
def requirements
- routes.map { |x| x[2] }
+ @my_routes.map { |x| x[2] }
end
def asts
- conditions.map { |hash| hash[:parsed_path_info] }
+ routes.map(&:path).map(&:spec)
end
end