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

ruby-changes:62379

From: nagachika <ko1@a...>
Date: Thu, 23 Jul 2020 17:23:01 +0900 (JST)
Subject: [ruby-changes:62379] c53cee7a0e (ruby_2_7): merge revision(s) 72c02aa4b79731c7f25c9267f74b347f1946c704: [Backport #16662]

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

From c53cee7a0e7b3e87ba3fbafa86bd74460af18d93 Mon Sep 17 00:00:00 2001
From: nagachika <nagachika@r...>
Date: Thu, 23 Jul 2020 17:22:45 +0900
Subject: merge revision(s) 72c02aa4b79731c7f25c9267f74b347f1946c704: [Backport
 #16662]

	Moved not-implemented method tests [Bug #16662]

	Test not-implemented method with the dedicated methods, instead of
	platform dependent features.

diff --git a/test/-ext-/test_notimplement.rb b/test/-ext-/test_notimplement.rb
index 92a2fd2..038b507 100644
--- a/test/-ext-/test_notimplement.rb
+++ b/test/-ext-/test_notimplement.rb
@@ -13,10 +13,17 @@ class Test_NotImplement < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/-ext-/test_notimplement.rb#L13
   end
 
   def test_respond_to
+    assert_include(Bug.methods(false), :notimplement)
+    assert_include(Bug::NotImplement.instance_methods(false), :notimplement)
     assert_not_respond_to(Bug, :notimplement)
     assert_not_respond_to(Bug::NotImplement.new, :notimplement)
   end
 
+  def test_method_inspect_notimplement
+    assert_match(/not-implemented/, Bug.method(:notimplement).inspect)
+    assert_match(/not-implemented/, Bug::NotImplement.instance_method(:notimplement).inspect)
+  end
+
   def test_not_method_defined
     assert !Bug::NotImplement.method_defined?(:notimplement)
     assert !Bug::NotImplement.method_defined?(:notimplement, true)
diff --git a/test/ruby/test_notimp.rb b/test/ruby/test_notimp.rb
deleted file mode 100644
index e13db69..0000000
--- a/test/ruby/test_notimp.rb
+++ /dev/null
@@ -1,90 +0,0 @@ https://github.com/ruby/ruby/blob/trunk/test/-ext-/test_notimplement.rb#L0
-# frozen_string_literal: false
-require 'test/unit'
-require 'timeout'
-require 'tmpdir'
-
-class TestNotImplement < Test::Unit::TestCase
-  def test_respond_to_fork
-    assert_include(Process.methods, :fork)
-    if /linux/ =~ RUBY_PLATFORM
-      assert_equal(true, Process.respond_to?(:fork))
-    end
-  end
-
-  def test_respond_to_lchmod
-    assert_include(File.methods, :lchmod)
-    case RUBY_PLATFORM
-    when /freebsd/, /linux-musl/
-      assert_equal(true, File.respond_to?(:lchmod))
-    when /linux/
-      assert_equal(false, File.respond_to?(:lchmod))
-    end
-  end
-
-  def test_call_fork
-    GC.start
-    pid = nil
-    ps =
-      case RUBY_PLATFORM
-      when /linux/ # assume Linux Distribution uses procps
-        proc {`ps -eLf #{pid}`}
-      when /freebsd/
-        proc {`ps -lH #{pid}`}
-      when /darwin/
-        proc {`ps -lM #{pid}`}
-      else
-        proc {`ps -l #{pid}`}
-      end
-    assert_nothing_raised(Timeout::Error, ps) do
-      EnvUtil.timeout(20) {
-        pid = fork {}
-        Process.wait pid
-        pid = nil
-      }
-    end
-  ensure
-    if pid
-      Process.kill(:KILL, pid)
-      Process.wait pid
-    end
-  end if Process.respond_to?(:fork)
-
-  def test_call_lchmod
-    if File.respond_to?(:lchmod)
-      Dir.mktmpdir {|d|
-        f = "#{d}/f"
-        g = "#{d}/g"
-        File.open(f, "w") {}
-        File.symlink f, g
-        newmode = 0444
-        begin
-          File.lchmod newmode, "#{d}/g"
-        rescue Errno::EOPNOTSUPP
-          skip $!
-        else
-          snew = File.lstat(g)
-          assert_equal(newmode, snew.mode & 0777)
-        end
-      }
-    end
-  end
-
-  def test_method_inspect_fork
-    m = Process.method(:fork)
-    if Process.respond_to?(:fork)
-      assert_not_match(/not-implemented/, m.inspect)
-    else
-      assert_match(/not-implemented/, m.inspect)
-    end
-  end
-
-  def test_method_inspect_lchmod
-    m = File.method(:lchmod)
-    if File.respond_to?(:lchmod)
-      assert_not_match(/not-implemented/, m.inspect)
-    else
-      assert_match(/not-implemented/, m.inspect)
-    end
-  end
-
-end
diff --git a/version.h b/version.h
index 8ba74e9..8cb4ea4 100644
--- a/version.h
+++ b/version.h
@@ -2,7 +2,7 @@ https://github.com/ruby/ruby/blob/trunk/version.h#L2
 # define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR
 #define RUBY_VERSION_TEENY 1
 #define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
-#define RUBY_PATCHLEVEL 104
+#define RUBY_PATCHLEVEL 105
 
 #define RUBY_RELEASE_YEAR 2020
 #define RUBY_RELEASE_MONTH 7
-- 
cgit v0.10.2


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

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