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

ruby-changes:67905

From: Hiroshi <ko1@a...>
Date: Sat, 11 Sep 2021 08:48:49 +0900 (JST)
Subject: [ruby-changes:67905] 151a1cd45e (master): Fixed inconsistent require order for assertions and core_assertions

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

From 151a1cd45eb28982083d0c2c99ed8c564c18a0af Mon Sep 17 00:00:00 2001
From: Hiroshi SHIBATA <hsbt@r...>
Date: Fri, 10 Sep 2021 20:41:52 +0900
Subject: Fixed inconsistent require order for assertions and core_assertions

---
 test/ruby/test_module.rb         | 1 +
 tool/lib/core_assertions.rb      | 2 --
 tool/lib/test/unit/assertions.rb | 1 -
 tool/lib/test/unit/testcase.rb   | 6 ++++--
 tool/test/webrick/utils.rb       | 2 ++
 5 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb
index 59b3df5..98c9128 100644
--- a/test/ruby/test_module.rb
+++ b/test/ruby/test_module.rb
@@ -1046,6 +1046,7 @@ class TestModule < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_module.rb#L1046
 
   def test_attr_obsoleted_flag
     c = Class.new do
+      extend Test::Unit::Assertions
       extend Test::Unit::CoreAssertions
       def initialize
         @foo = :foo
diff --git a/tool/lib/core_assertions.rb b/tool/lib/core_assertions.rb
index 5720eb1..f94a5df 100644
--- a/tool/lib/core_assertions.rb
+++ b/tool/lib/core_assertions.rb
@@ -25,9 +25,7 @@ module Test https://github.com/ruby/ruby/blob/trunk/tool/lib/core_assertions.rb#L25
 
     module CoreAssertions
       require_relative 'envutil'
-
       require 'pp'
-      include Test::Unit::Assertions
 
       def mu_pp(obj) #:nodoc:
         obj.pretty_inspect.chomp
diff --git a/tool/lib/test/unit/assertions.rb b/tool/lib/test/unit/assertions.rb
index db81285..bdb25d0 100644
--- a/tool/lib/test/unit/assertions.rb
+++ b/tool/lib/test/unit/assertions.rb
@@ -1,5 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/tool/lib/test/unit/assertions.rb#L1
 # frozen_string_literal: true
-require_relative '../../core_assertions'
 require 'pp'
 
 module Test
diff --git a/tool/lib/test/unit/testcase.rb b/tool/lib/test/unit/testcase.rb
index 6ce9f59..ea3092a 100644
--- a/tool/lib/test/unit/testcase.rb
+++ b/tool/lib/test/unit/testcase.rb
@@ -1,5 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/tool/lib/test/unit/testcase.rb#L1
 # frozen_string_literal: true
 require 'test/unit/assertions'
+require_relative '../../core_assertions'
 
 module Test
   module Unit
@@ -143,6 +144,9 @@ module Test https://github.com/ruby/ruby/blob/trunk/tool/lib/test/unit/testcase.rb#L144
     # See MiniTest::Assertions
 
     class TestCase
+      include Assertions
+      include CoreAssertions
+
       include LifecycleHooks
       include Guard
       extend Guard
@@ -332,8 +336,6 @@ module Test https://github.com/ruby/ruby/blob/trunk/tool/lib/test/unit/testcase.rb#L336
 
       def teardown; end
 
-      include CoreAssertions
-
       def on_parallel_worker?
         false
       end
diff --git a/tool/test/webrick/utils.rb b/tool/test/webrick/utils.rb
index 85fc2bc..a8568d0 100644
--- a/tool/test/webrick/utils.rb
+++ b/tool/test/webrick/utils.rb
@@ -36,6 +36,8 @@ module TestWEBrick https://github.com/ruby/ruby/blob/trunk/tool/test/webrick/utils.rb#L36
   RubyBinArray << "-I" << "#{File.dirname(EnvUtil.rubybin)}/.ext/#{RUBY_PLATFORM}"
 
   require "test/unit" unless defined?(Test::Unit)
+  include Test::Unit::Assertions
+  extend Test::Unit::Assertions
   include Test::Unit::CoreAssertions
   extend Test::Unit::CoreAssertions
 
-- 
cgit v1.1


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

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