aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2015-05-04 11:42:22 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2015-05-04 11:42:22 -0300
commit9619331001828a9877b7a1e1a451f7ab98ca0285 (patch)
treeaac468a12ea10f4bc2043fac7a47b59565a1c2b3 /activesupport
parentcec46fbec48367287920df53446f59f159c9fed5 (diff)
parentbf501e7ff5f66da631bff280d3af2605e5309b85 (diff)
downloadrails-9619331001828a9877b7a1e1a451f7ab98ca0285.tar.gz
rails-9619331001828a9877b7a1e1a451f7ab98ca0285.tar.bz2
rails-9619331001828a9877b7a1e1a451f7ab98ca0285.zip
Merge pull request #20006 from vngrs/refactor_test_order_method
refactor ActiveSupport::TestCase.test_order method with memoization
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/test_case.rb9
1 files changed, 1 insertions, 8 deletions
diff --git a/activesupport/lib/active_support/test_case.rb b/activesupport/lib/active_support/test_case.rb
index 24b8f4b9f9..d9a668c0ea 100644
--- a/activesupport/lib/active_support/test_case.rb
+++ b/activesupport/lib/active_support/test_case.rb
@@ -36,14 +36,7 @@ module ActiveSupport
# Possible values are +:random+, +:parallel+, +:alpha+, +:sorted+.
# Defaults to +:random+.
def test_order
- test_order = ActiveSupport.test_order
-
- if test_order.nil?
- test_order = :random
- self.test_order = test_order
- end
-
- test_order
+ ActiveSupport.test_order ||= :random
end
end