[前][次][番号順一覧][スレッド一覧]

ruby-changes:67968

From: Hiroshi <ko1@a...>
Date: Mon, 13 Sep 2021 14:39:41 +0900 (JST)
Subject: [ruby-changes:67968] dbdceb8a19 (master): Removed workaround for test_order

https://git.ruby-lang.org/ruby.git/commit/?id=dbdceb8a19

From dbdceb8a191b540caae534d28cee6f20a9759d50 Mon Sep 17 00:00:00 2001
From: Hiroshi SHIBATA <hsbt@r...>
Date: Mon, 13 Sep 2021 11:31:38 +0900
Subject: Removed workaround for test_order

---
 tool/lib/test/unit/testcase.rb | 21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)

diff --git a/tool/lib/test/unit/testcase.rb b/tool/lib/test/unit/testcase.rb
index 565a69a..dab25de 100644
--- a/tool/lib/test/unit/testcase.rb
+++ b/tool/lib/test/unit/testcase.rb
@@ -256,8 +256,14 @@ module Test https://github.com/ruby/ruby/blob/trunk/tool/lib/test/unit/testcase.rb#L256
         super
       end
 
-      def self.test_order # :nodoc:
-        :sorted
+      @test_order = :sorted
+
+      class << self
+        attr_writer :test_order
+      end
+
+      def self.test_order
+        defined?(@test_order) ? @test_order : superclass.test_order
       end
 
       def self.test_suites # :nodoc:
@@ -335,17 +341,6 @@ module Test https://github.com/ruby/ruby/blob/trunk/tool/lib/test/unit/testcase.rb#L341
         end
         @test_methods[name] = true
       end
-
-      test_order = self.test_order
-      class << self
-        attr_writer :test_order
-        undef test_order
-      end
-      def self.test_order
-        defined?(@test_order) ? @test_order : superclass.test_order
-      end
-      self.test_order = test_order
-
     end
   end
 end
-- 
cgit v1.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]