aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/test_case.rb
diff options
context:
space:
mode:
authorMehmet Emin İNAÇ <mehmetemininac@gmail.com>2015-05-04 14:46:12 +0300
committerMehmet Emin İNAÇ <mehmetemininac@gmail.com>2015-05-04 14:46:12 +0300
commitbf501e7ff5f66da631bff280d3af2605e5309b85 (patch)
tree600c08c17f63a141f658965ed5917a196852d4df /activesupport/lib/active_support/test_case.rb
parent21c74bd769f6c873453e9244b0de7ced40a532be (diff)
downloadrails-bf501e7ff5f66da631bff280d3af2605e5309b85.tar.gz
rails-bf501e7ff5f66da631bff280d3af2605e5309b85.tar.bz2
rails-bf501e7ff5f66da631bff280d3af2605e5309b85.zip
refactor ActiveSupport::TestCase.test_order method with memoization
Diffstat (limited to 'activesupport/lib/active_support/test_case.rb')
-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