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

ruby-changes:72314

From: Nobuyoshi <ko1@a...>
Date: Sat, 25 Jun 2022 19:11:33 +0900 (JST)
Subject: [ruby-changes:72314] f159bbd17d (master): Prevent accidental use of assert_raises

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

From f159bbd17da88a7f456e0ec7fbf7890135d456a3 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Sat, 25 Jun 2022 19:05:36 +0900
Subject: Prevent accidental use of assert_raises

---
 tool/lib/core_assertions.rb      | 4 ++++
 tool/lib/test/unit/assertions.rb | 4 ----
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tool/lib/core_assertions.rb b/tool/lib/core_assertions.rb
index 723a1742c5..67373139ca 100644
--- a/tool/lib/core_assertions.rb
+++ b/tool/lib/core_assertions.rb
@@ -3,6 +3,10 @@ https://github.com/ruby/ruby/blob/trunk/tool/lib/core_assertions.rb#L3
 module Test
   module Unit
     module Assertions
+      def assert_raises(*exp, &b)
+        raise NoMethodError, "use assert_raise", caller
+      end
+
       def _assertions= n # :nodoc:
         @_assertions = n
       end
diff --git a/tool/lib/test/unit/assertions.rb b/tool/lib/test/unit/assertions.rb
index 3244913a36..b4f1dbc176 100644
--- a/tool/lib/test/unit/assertions.rb
+++ b/tool/lib/test/unit/assertions.rb
@@ -563,10 +563,6 @@ module Test https://github.com/ruby/ruby/blob/trunk/tool/lib/test/unit/assertions.rb#L563
         assert yield, *msgs
       end
 
-      def assert_raises(*exp, &b)
-        raise NoMethodError, "use assert_raise", caller
-      end
-
       # :call-seq:
       #   assert_nothing_thrown( failure_message = nil, &block )
       #
-- 
cgit v1.2.1


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

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