Permalink
Browse files

Store the singleton_class in a local variable

  • Loading branch information...
1 parent 7cf9a1c commit 17cb1266c7b91c934dcef2afe38ea4dab677ef91 @rafaelfranca rafaelfranca committed Jan 29, 2014
Showing with 4 additions and 3 deletions.
  1. +4 −3 activesupport/lib/active_support/testing/time_helpers.rb
@@ -32,9 +32,10 @@ def unstub_all!
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
+ singleton_class = stub.object.singleton_class
+ singleton_class.send :undef_method, stub.method_name
+ singleton_class.send :alias_method, stub.method_name, stub.original_method
+ singleton_class.send :undef_method, stub.original_method
end
end

0 comments on commit 17cb126

Please sign in to comment.