зеркало из https://github.com/github/ruby.git
[ruby/io-console] Expanded expected errors
May fail with ENOTTY instead of ENODEV. https://github.com/ruby/io-console/commit/fe117b89e0
This commit is contained in:
Родитель
0a86679a7b
Коммит
d7a59e2ffe
|
@ -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)
|
||||
|
|
Загрузка…
Ссылка в новой задаче