Permalink
Browse files

Rename metaclass to singleton_class

  • Loading branch information...
1 parent 8760add commit f863045c45fbbe5972f557c02b729441ffe81502 Carlhuda committed Feb 26, 2010
@@ -147,7 +147,7 @@ def with_routing
# ROUTES TODO: Figure out this insanity
silence_warnings { ::ActionController.const_set(:UrlFor, @router.named_url_helpers) }
_router = @router
- @controller.metaclass.send(:send, :include, @router.named_url_helpers) if @controller
+ @controller.singleton_class.send(:send, :include, @router.named_url_helpers) if @controller
yield @router
ensure
@router = old_routes
@@ -512,7 +512,7 @@ def reset!
@response = ActionController::TestResponse.new
@controller = ActionCachingTestController.new
# ROUTES TODO: It seems bad to explicitly remix in the class
- @controller.metaclass.send(:include, @router.named_url_helpers)
+ @controller.singleton_class.send(:include, @router.named_url_helpers)
@request.host = 'hostname.com'
end
@@ -396,7 +396,7 @@ def with_test_route_set
get 'get/:action', :to => controller
end
- self.metaclass.send(:include, set.named_url_helpers)
+ self.singleton_class.send(:include, set.named_url_helpers)
yield
end
@@ -1231,7 +1231,7 @@ def assert_restful_named_routes_for(controller_name, singular_name = nil, option
@controller = "#{options[:options][:controller].camelize}Controller".constantize.new
# ROUTES TODO: Figure out a way to not extend the routing helpers here
- @controller.metaclass.send(:include, @router.named_url_helpers)
+ @controller.singleton_class.send(:include, @router.named_url_helpers)
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
get :index, options[:options]
@@ -1301,7 +1301,7 @@ def assert_singleton_routes_for(singleton_name, options = {})
def assert_singleton_named_routes_for(singleton_name, options = {})
(options[:options] ||= {})[:controller] ||= singleton_name.to_s.pluralize
@controller = "#{options[:options][:controller].camelize}Controller".constantize.new
- @controller.metaclass.send(:include, @router.named_url_helpers)
+ @controller.singleton_class.send(:include, @router.named_url_helpers)
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
get :show, options[:options]

0 comments on commit f863045

Please sign in to comment.