summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/io/console/test_io_console.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/io/console/test_io_console.rb b/test/io/console/test_io_console.rb
index eb0bb22c39..59384533ad 100644
--- a/test/io/console/test_io_console.rb
+++ b/test/io/console/test_io_console.rb
@@ -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)