mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #20006 from vngrs/refactor_test_order_method
refactor ActiveSupport::TestCase.test_order method with memoization
This commit is contained in:
commit
9619331001
1 changed files with 1 additions and 8 deletions
|
@ -36,14 +36,7 @@ module ActiveSupport
|
||||||
# Possible values are +:random+, +:parallel+, +:alpha+, +:sorted+.
|
# Possible values are +:random+, +:parallel+, +:alpha+, +:sorted+.
|
||||||
# Defaults to +:random+.
|
# Defaults to +:random+.
|
||||||
def test_order
|
def test_order
|
||||||
test_order = ActiveSupport.test_order
|
ActiveSupport.test_order ||= :random
|
||||||
|
|
||||||
if test_order.nil?
|
|
||||||
test_order = :random
|
|
||||||
self.test_order = test_order
|
|
||||||
end
|
|
||||||
|
|
||||||
test_order
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue