diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-05-04 11:42:22 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-05-04 11:42:22 -0300 |
commit | 9619331001828a9877b7a1e1a451f7ab98ca0285 (patch) | |
tree | aac468a12ea10f4bc2043fac7a47b59565a1c2b3 /activesupport | |
parent | cec46fbec48367287920df53446f59f159c9fed5 (diff) | |
parent | bf501e7ff5f66da631bff280d3af2605e5309b85 (diff) | |
download | rails-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.rb | 9 |
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 |