Skip to content

Commit

Permalink
Move the condition to omit outside the method
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Jan 30, 2024
1 parent 1f2877a commit 8b9b5b6
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions test/io/console/test_io_console.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,20 @@ def set_winsize_teardown
trap(:TTOU, @old_ttou) if defined?(@old_ttou) and @old_ttou
end

exceptions = %w[ENODEV ENOTTY EBADF ENXIO].map {|e|
Errno.const_get(e) if Errno.const_defined?(e)
}
exceptions.compact!
FailedPathExceptions = (exceptions unless exceptions.empty?)

def test_failed_path
exceptions = %w[ENODEV ENOTTY EBADF ENXIO].map {|e|
Errno.const_get(e) if Errno.const_defined?(e)
}
exceptions.compact!
omit if exceptions.empty?
File.open(IO::NULL) do |f|
e = assert_raise(*exceptions) do
e = assert_raise(*FailedPathExceptions) do
f.echo?
end
assert_include(e.message, IO::NULL)
end
end
end if FailedPathExceptions

def test_bad_keyword
# JRuby in CI still fails to reject this bad keyword argument
Expand Down

0 comments on commit 8b9b5b6

Please sign in to comment.