Skip to content

Commit

Permalink
Fix "Relax expectations of errors from getgrnam"
Browse files Browse the repository at this point in the history
Use `assert_raise_kind_of` instead of `assert_raise`, that reject sub
classes of the given exceptions.
  • Loading branch information
nobu committed Jan 24, 2025
1 parent 4138b18 commit d4638b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/ruby/test_process.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1693,7 +1693,7 @@ def test_gid_from_name
if g = Etc.getgrgid(Process.gid)
assert_equal(Process.gid, Process::GID.from_name(g.name), g.name)
end
exc = assert_raise(ArgumentError, SystemCallError) do
exc = assert_raise_kind_of(ArgumentError, SystemCallError) do
Process::GID.from_name("\u{4e0d 5b58 5728}") # fu son zai ("absent" in Kanji)
end
assert_match(/\u{4e0d 5b58 5728}/, exc.message) if exc.is_a?(ArgumentError)
Expand Down

0 comments on commit d4638b9

Please sign in to comment.