From bf501e7ff5f66da631bff280d3af2605e5309b85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20Emin=20=C4=B0NA=C3=87?= Date: Mon, 4 May 2015 14:46:12 +0300 Subject: refactor ActiveSupport::TestCase.test_order method with memoization --- activesupport/lib/active_support/test_case.rb | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'activesupport/lib/active_support') 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 -- cgit v1.2.3