test_commit_email.rb: Ensure #teardown doesn't fail

if test is omitted.

Follow up c4e090def1
This commit is contained in:
Takashi Kokubun committed 2025-12-17 10:22:00 -08:00
1 parent a9526ab50c
commit dc2a62e14c
1 file changed
+8 -3
+8 -3
View File
@@ -36,9 +36,14 @@ class TestCommitEmail < Test::Unit::TestCase
end
def teardown
File.unlink(@sendmail)
Dir.rmdir(File.dirname(@sendmail))
FileUtils.rm_rf(@ruby)
# Clean up temporary files if #setup was not omitted
if @sendmail
File.unlink(@sendmail)
Dir.rmdir(File.dirname(@sendmail))
end
if @ruby
FileUtils.rm_rf(@ruby)
end
end
def test_sendmail_encoding