Skip to content

Commit

Permalink
Expanded expected errors
Browse files Browse the repository at this point in the history
May fail with ENOTTY instead of ENODEV.
  • Loading branch information
nobu committed May 9, 2020
1 parent 06a540f commit fe117b8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/io/console/test_io_console.rb
Expand Up @@ -31,9 +31,13 @@ def set_winsize_teardown
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)
Expand Down

0 comments on commit fe117b8

Please sign in to comment.