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

ruby-changes:61163

From: Nobuyoshi <ko1@a...>
Date: Sat, 9 May 2020 14:46:38 +0900 (JST)
Subject: [ruby-changes:61163] d7a59e2ffe (master): [ruby/io-console] Expanded expected errors

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

From d7a59e2ffe45b27c084a8fe8cfe12b63dd1e6de8 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Sat, 9 May 2020 14:40:19 +0900
Subject: [ruby/io-console] Expanded expected errors

May fail with ENOTTY instead of ENODEV.

https://github.com/ruby/io-console/commit/fe117b89e0

diff --git a/test/io/console/test_io_console.rb b/test/io/console/test_io_console.rb
index eb0bb22..5938453 100644
--- a/test/io/console/test_io_console.rb
+++ b/test/io/console/test_io_console.rb
@@ -31,9 +31,13 @@ class TestIO_Console < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/io/console/test_io_console.rb#L31
   end
 
   def test_failed_path
-    skip unless Errno.const_defined?(:ENODEV)
+    exceptions = %i[ENODEV ENOTTY].map {|e|
+      Errno.const_get(e) if Errno.const_defined?(e)
+    }
+    exceptions.compact!
+    skip if exceptions.empty?
     File.open(IO::NULL) do |f|
-      e = assert_raise(Errno::ENODEV) do
+      e = assert_raise(*exceptions) do
         f.echo?
       end
       assert_include(e.message, IO::NULL)
-- 
cgit v0.10.2


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

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