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

ruby-changes:67929

From: Nobuyoshi <ko1@a...>
Date: Sat, 11 Sep 2021 16:30:50 +0900 (JST)
Subject: [ruby-changes:67929] 30b4da2bc1 (master): Update the test tool path

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

From 30b4da2bc1300bb37c7d6cd3b097768a99ab4dba Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Sat, 11 Sep 2021 16:25:10 +0900
Subject: Update the test tool path

---
 tool/lib/core_assertions.rb | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tool/lib/core_assertions.rb b/tool/lib/core_assertions.rb
index b4090f2..3bfc4ef 100644
--- a/tool/lib/core_assertions.rb
+++ b/tool/lib/core_assertions.rb
@@ -463,7 +463,7 @@ eom https://github.com/ruby/ruby/blob/trunk/tool/lib/core_assertions.rb#L463
         ex
       end
 
-      MINI_DIR = File.join(File.dirname(File.expand_path(__FILE__)), "minitest") #:nodoc:
+      TEST_DIR = File.join(__dir__, "test/unit") #:nodoc:
 
       # :call-seq:
       #   assert(test, [failure_message])
@@ -483,7 +483,7 @@ eom https://github.com/ruby/ruby/blob/trunk/tool/lib/core_assertions.rb#L483
         when nil
           msgs.shift
         else
-          bt = caller.reject { |s| s.start_with?(MINI_DIR) }
+          bt = caller.reject { |s| s.start_with?(TEST_DIR) }
           raise ArgumentError, "assertion message must be String or Proc, but #{msg.class} was given.", bt
         end unless msgs.empty?
         super
@@ -506,7 +506,7 @@ eom https://github.com/ruby/ruby/blob/trunk/tool/lib/core_assertions.rb#L506
           return assert obj.respond_to?(meth, *priv), msg
         end
         #get rid of overcounting
-        if caller_locations(1, 1)[0].path.start_with?(MINI_DIR)
+        if caller_locations(1, 1)[0].path.start_with?(TEST_DIR)
           return if obj.respond_to?(meth)
         end
         super(obj, meth, msg)
@@ -529,7 +529,7 @@ eom https://github.com/ruby/ruby/blob/trunk/tool/lib/core_assertions.rb#L529
           return assert !obj.respond_to?(meth, *priv), msg
         end
         #get rid of overcounting
-        if caller_locations(1, 1)[0].path.start_with?(MINI_DIR)
+        if caller_locations(1, 1)[0].path.start_with?(TEST_DIR)
           return unless obj.respond_to?(meth)
         end
         refute_respond_to(obj, meth, msg)
-- 
cgit v1.1


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

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