From f863045c45fbbe5972f557c02b729441ffe81502 Mon Sep 17 00:00:00 2001 From: Carlhuda Date: Thu, 25 Feb 2010 17:56:58 -0800 Subject: Rename metaclass to singleton_class --- actionpack/lib/action_dispatch/testing/assertions/routing.rb | 2 +- actionpack/test/controller/caching_test.rb | 2 +- actionpack/test/controller/integration_test.rb | 2 +- actionpack/test/controller/resources_test.rb | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'actionpack') diff --git a/actionpack/lib/action_dispatch/testing/assertions/routing.rb b/actionpack/lib/action_dispatch/testing/assertions/routing.rb index 17caa2e030..5a3ff5a04c 100644 --- a/actionpack/lib/action_dispatch/testing/assertions/routing.rb +++ b/actionpack/lib/action_dispatch/testing/assertions/routing.rb @@ -147,7 +147,7 @@ module ActionDispatch # 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 diff --git a/actionpack/test/controller/caching_test.rb b/actionpack/test/controller/caching_test.rb index 9c9d886f5d..98cea945a7 100644 --- a/actionpack/test/controller/caching_test.rb +++ b/actionpack/test/controller/caching_test.rb @@ -512,7 +512,7 @@ class ActionCacheTest < ActionController::TestCase @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 diff --git a/actionpack/test/controller/integration_test.rb b/actionpack/test/controller/integration_test.rb index 1611a549fd..437d26e4ed 100644 --- a/actionpack/test/controller/integration_test.rb +++ b/actionpack/test/controller/integration_test.rb @@ -396,7 +396,7 @@ class IntegrationProcessTest < ActionController::IntegrationTest 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 diff --git a/actionpack/test/controller/resources_test.rb b/actionpack/test/controller/resources_test.rb index 6f3c16f588..b377e5bbbc 100644 --- a/actionpack/test/controller/resources_test.rb +++ b/actionpack/test/controller/resources_test.rb @@ -1231,7 +1231,7 @@ class ResourcesTest < ActionController::TestCase @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 @@ class ResourcesTest < ActionController::TestCase 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] -- cgit v1.2.3