Permalink
Browse files

Change the class and method visibility

  • Loading branch information...
rafaelfranca committed Jan 29, 2014
1 parent 6dce436 commit 7cf9a1c6a6cba5565817aa11edc227b6369685e7
Showing with 13 additions and 9 deletions.
  1. +13 −9 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 @@ def unstub_all!
@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 @@ def travel_to(date_or_time, &block)
end
end
- def simple_stubs
- @simple_stubs ||= SimpleStubs.new
- end
+ private
+
+ def simple_stubs
+ @simple_stubs ||= SimpleStubs.new
+ end
end
end
end

0 comments on commit 7cf9a1c

Please sign in to comment.