summaryrefslogtreecommitdiff
path: root/test/io/console
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-05-09 14:40:19 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-05-09 14:46:08 +0900
commitd7a59e2ffe45b27c084a8fe8cfe12b63dd1e6de8 (patch)
tree68071c45142a088e3c6c8944574c7a67266fce87 /test/io/console
parent0a86679a7b430242a9618bd26857e68f6bcd6278 (diff)
[ruby/io-console] Expanded expected errors
May fail with ENOTTY instead of ENODEV. https://github.com/ruby/io-console/commit/fe117b89e0
Diffstat (limited to 'test/io/console')
-rw-r--r--test/io/console/test_io_console.rb8
1 files changed, 6 insertions, 2 deletions
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)