ruby-changes:66208
From: Yusuke <ko1@a...>
Date: Fri, 14 May 2021 18:10:48 +0900 (JST)
Subject: [ruby-changes:66208] 5f8bca3257 (master): tool/lib/minitest/mock.rb: define Object#stub only when not defined
https://git.ruby-lang.org/ruby.git/commit/?id=5f8bca3257 From 5f8bca32571fa9c651f6903d36f66082363f8879 Mon Sep 17 00:00:00 2001 From: Yusuke Endoh <mame@r...> Date: Fri, 14 May 2021 18:10:07 +0900 Subject: tool/lib/minitest/mock.rb: define Object#stub only when not defined Recently, lib/rubygems/test_case.rb also defines the method. --- tool/lib/minitest/mock.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tool/lib/minitest/mock.rb b/tool/lib/minitest/mock.rb index 224b06c..a723084 100644 --- a/tool/lib/minitest/mock.rb +++ b/tool/lib/minitest/mock.rb @@ -192,5 +192,5 @@ class Object # :nodoc: https://github.com/ruby/ruby/blob/trunk/tool/lib/minitest/mock.rb#L192 metaclass.send :undef_method, name metaclass.send :alias_method, name, new_name metaclass.send :undef_method, new_name - end + end unless method_defined?(:stub) # lib/rubygems/test_case.rb also has the same method definition end -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/