Skip to content

Commit 06a540f

Browse files
committed
Added test for failed path
1 parent 6a4b1c1 commit 06a540f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/io/console/test_io_console.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@ def set_winsize_setup
2929
def set_winsize_teardown
3030
trap(:TTOU, @old_ttou) if defined?(@old_ttou) and @old_ttou
3131
end
32+
33+
def test_failed_path
34+
skip unless Errno.const_defined?(:ENODEV)
35+
File.open(IO::NULL) do |f|
36+
e = assert_raise(Errno::ENODEV) do
37+
f.echo?
38+
end
39+
assert_include(e.message, IO::NULL)
40+
end
41+
end
3242
end
3343

3444
defined?(PTY) and defined?(IO.console) and TestIO_Console.class_eval do

0 commit comments

Comments
 (0)