Skip to content

Commit

Permalink
Store the singleton_class in a local variable
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelfranca committed Jan 29, 2014
1 parent 7cf9a1c commit 17cb126
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions activesupport/lib/active_support/testing/time_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 17cb126

Please sign in to comment.