diff options
-rw-r--r-- | activesupport/lib/active_support/testing/time_helpers.rb | 22 |
1 files 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 |