Skip to content

Commit

Permalink
refactor ActiveSupport::TestCase.test_order method with memoization
Browse files Browse the repository at this point in the history
  • Loading branch information
meinac committed May 4, 2015
1 parent 21c74bd commit bf501e7
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions activesupport/lib/active_support/test_case.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,7 @@ def test_order=(new_order)
# 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

Expand Down

0 comments on commit bf501e7

Please sign in to comment.