From cc5e563f0fa5212e4a624b954fbc97cc6d8900d4 Mon Sep 17 00:00:00 2001
From: Jiaying Song <jiaying.song.cn@windriver.com>
Date: Mon, 25 Aug 2025 16:31:18 +0800
Subject: [PATCH] Skip test_rm_r_no_permissions test under root

Skip the test_rm_r_no_permissions test under the root user, as deletion always succeeds.

Upstream-Status: Submitted [https://github.com/ruby/fileutils/pull/133/commits/3c831389c5e1523af5869d025f573ff043486b99]

Signed-off-by: Jiaying Song <jiaying.song.cn@windriver.com>
---
 test/fileutils/test_fileutils.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb
index 481f913..a2ed414 100644
--- a/test/fileutils/test_fileutils.rb
+++ b/test/fileutils/test_fileutils.rb
@@ -757,7 +757,7 @@ class TestFileUtils < Test::Unit::TestCase
   def test_rm_r_no_permissions
     check_singleton :rm_rf
 
-    return if /mswin|mingw/ =~ RUBY_PLATFORM
+    return if /mswin|mingw/ =~ RUBY_PLATFORM || root_in_posix?
 
     mkdir 'tmpdatadir'
     touch 'tmpdatadir/tmpdata'
-- 
2.34.1

