[ruby/io-console] Expanded expected errors

May fail with ENOTTY instead of ENODEV.

https://github.com/ruby/io-console/commit/fe117b89e0
上级 0a86679a
......@@ -31,9 +31,13 @@ def set_winsize_teardown
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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册