aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-01-29 21:17:05 -0200
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-01-29 21:24:34 -0200
commit17cb1266c7b91c934dcef2afe38ea4dab677ef91 (patch)
treedb507da238f8bb3401cb511939d4151752cf72b2 /activesupport
parent7cf9a1c6a6cba5565817aa11edc227b6369685e7 (diff)
downloadrails-17cb1266c7b91c934dcef2afe38ea4dab677ef91.tar.gz
rails-17cb1266c7b91c934dcef2afe38ea4dab677ef91.tar.bz2
rails-17cb1266c7b91c934dcef2afe38ea4dab677ef91.zip
Store the singleton_class in a local variable
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/testing/time_helpers.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/testing/time_helpers.rb b/activesupport/lib/active_support/testing/time_helpers.rb
index af19c5a9f5..84cbdf9608 100644
--- a/activesupport/lib/active_support/testing/time_helpers.rb
+++ b/activesupport/lib/active_support/testing/time_helpers.rb
@@ -32,9 +32,10 @@ module ActiveSupport
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