1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/io-console] Added test for failed path

06a540f9b4
This commit is contained in:
Nobuyoshi Nakada 2020-05-09 13:55:48 +09:00
parent 0ce45db115
commit cc9bc14530

View file

@ -29,6 +29,16 @@ class TestIO_Console < Test::Unit::TestCase
def set_winsize_teardown
trap(:TTOU, @old_ttou) if defined?(@old_ttou) and @old_ttou
end
def test_failed_path
skip unless Errno.const_defined?(:ENODEV)
File.open(IO::NULL) do |f|
e = assert_raise(Errno::ENODEV) do
f.echo?
end
assert_include(e.message, IO::NULL)
end
end
end
defined?(PTY) and defined?(IO.console) and TestIO_Console.class_eval do