summaryrefslogtreecommitdiff
path: root/test/io
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-05-09 13:55:48 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-05-09 13:57:04 +0900
commitcc9bc145300d129f27ad3a4ce186d7b1e3068b88 (patch)
tree6abefb27394488a281b3dd3017aac96b321b1a9b /test/io
parent0ce45db11536ecba8cc6a4d46ac448b162a96d51 (diff)
[ruby/io-console] Added test for failed path
https://github.com/ruby/io-console/commit/06a540f9b4
Diffstat (limited to 'test/io')
-rw-r--r--test/io/console/test_io_console.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/io/console/test_io_console.rb b/test/io/console/test_io_console.rb
index a02605dd1e..eb0bb22c39 100644
--- a/test/io/console/test_io_console.rb
+++ b/test/io/console/test_io_console.rb
@@ -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