From 7cf9a1c6a6cba5565817aa11edc227b6369685e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Wed, 29 Jan 2014 21:16:52 -0200 Subject: Change the class and method visibility --- .../lib/active_support/testing/time_helpers.rb | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/activesupport/lib/active_support/testing/time_helpers.rb b/activesupport/lib/active_support/testing/time_helpers.rb index 77b8ba261e..af19c5a9f5 100644 --- a/activesupport/lib/active_support/testing/time_helpers.rb +++ b/activesupport/lib/active_support/testing/time_helpers.rb @@ -1,6 +1,6 @@ module ActiveSupport module Testing - class SimpleStubs + class SimpleStubs # :nodoc: Stub = Struct.new(:object, :method_name, :original_method) def initialize @@ -29,11 +29,13 @@ module ActiveSupport @stubs = {} end - def unstub_object(stub) - stub.object.singleton_class.send :undef_method, stub.method_name - stub.object.singleton_class.send :alias_method, stub.method_name, stub.original_method - stub.object.singleton_class.send :undef_method, stub.original_method - end + private + + def unstub_object(stub) + stub.object.singleton_class.send :undef_method, stub.method_name + stub.object.singleton_class.send :alias_method, stub.method_name, stub.original_method + stub.object.singleton_class.send :undef_method, stub.original_method + end end # Containing helpers that helps you test passage of time. @@ -91,9 +93,11 @@ module ActiveSupport end end - def simple_stubs - @simple_stubs ||= SimpleStubs.new - end + private + + def simple_stubs + @simple_stubs ||= SimpleStubs.new + end end end end -- cgit v1.2.3