From d7a59e2ffe45b27c084a8fe8cfe12b63dd1e6de8 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada 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 --- test/io/console/test_io_console.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/io/console/test_io_console.rb b/test/io/console/test_io_console.rb index eb0bb22c39..59384533ad 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 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 v1.2.3