Skip to content

Commit 96a5da6

Browse files
committed
Fix "Relax expectations of errors from getgrnam"
Use `assert_raise_kind_of` instead of `assert_raise`, that rejects sub classes of the given exceptions.
1 parent 4138b18 commit 96a5da6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/ruby/test_process.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1693,7 +1693,7 @@ def test_gid_from_name
16931693
if g = Etc.getgrgid(Process.gid)
16941694
assert_equal(Process.gid, Process::GID.from_name(g.name), g.name)
16951695
end
1696-
exc = assert_raise(ArgumentError, SystemCallError) do
1696+
exc = assert_raise_kind_of(ArgumentError, SystemCallError) do
16971697
Process::GID.from_name("\u{4e0d 5b58 5728}") # fu son zai ("absent" in Kanji)
16981698
end
16991699
assert_match(/\u{4e0d 5b58 5728}/, exc.message) if exc.is_a?(ArgumentError)

0 commit comments

Comments
 (0)