diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-01-29 21:16:52 -0200 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-01-29 21:24:03 -0200 |
commit | 7cf9a1c6a6cba5565817aa11edc227b6369685e7 (patch) | |
tree | 0ff0db00def5d6d5521baf204ea06741d9fecf92 /activesupport/lib/active_support | |
parent | 6dce4367c2bba894bb94e27cdfe4c56fdcc2c3df (diff) | |
download | rails-7cf9a1c6a6cba5565817aa11edc227b6369685e7.tar.gz rails-7cf9a1c6a6cba5565817aa11edc227b6369685e7.tar.bz2 rails-7cf9a1c6a6cba5565817aa11edc227b6369685e7.zip |
Change the class and method visibility
Diffstat (limited to 'activesupport/lib/active_support')
-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 |