@@ -381,17 +381,26 @@ def test_lchown
381381 end
382382
383383 def test_link
384- assert_send_type "(String, String) -> 0" ,
385- File , :link , File . expand_path ( __FILE__ ) , "new_name"
386- File . unlink ( "new_name" )
384+ begin
385+ assert_send_type "(String, String) -> 0" ,
386+ File , :link , File . expand_path ( __FILE__ ) , "new_name"
387+ ensure
388+ File . unlink ( "new_name" )
389+ end
387390
388- assert_send_type "(ToStr, ToStr) -> 0" ,
389- File , :link , ToStr . new ( File . expand_path ( __FILE__ ) ) , ToStr . new ( "new_name" )
390- File . unlink ( "new_name" )
391+ begin
392+ assert_send_type "(ToStr, ToStr) -> 0" ,
393+ File , :link , ToStr . new ( File . expand_path ( __FILE__ ) ) , ToStr . new ( "new_name" )
394+ ensure
395+ File . unlink ( "new_name" )
396+ end
391397
392- assert_send_type "(ToPath, ToPath) -> 0" ,
393- File , :link , ToPath . new ( File . expand_path ( __FILE__ ) ) , ToPath . new ( "new_name" )
394- File . unlink ( "new_name" )
398+ begin
399+ assert_send_type "(ToPath, ToPath) -> 0" ,
400+ File , :link , ToPath . new ( File . expand_path ( __FILE__ ) ) , ToPath . new ( "new_name" )
401+ ensure
402+ File . unlink ( "new_name" )
403+ end
395404 end
396405
397406 def test_lstat
0 commit comments