[rubygems/rubygems] Stay away from FileUtils.rm_rf in Bundler specs

Instead, skip the spec when run by ruby-core. Maybe the root cause can
be fixed at some point.

https://github.com/rubygems/rubygems/commit/09594ae5b8
This commit is contained in:
David Rodríguez 2025-03-31 20:20:56 +02:00 committed by Hiroshi SHIBATA
parent 79f3167e0b
commit cd1952484c

View File

@ -248,6 +248,7 @@ RSpec.describe "global gem caching" do
describe "extension caching" do
it "works" do
skip "gets incorrect ref in path" if Gem.win_platform?
skip "fails for unknown reason when run by ruby-core" if ruby_core?
build_git "very_simple_git_binary", &:add_c_extension
build_lib "very_simple_path_binary", &:add_c_extension
@ -275,7 +276,7 @@ RSpec.describe "global gem caching" do
R
expect(out).to eq "VERY_SIMPLE_BINARY_IN_C\nVERY_SIMPLE_GIT_BINARY_IN_C"
FileUtils.rm_rf Dir[home(".bundle", "cache", "extensions", "**", "*binary_c*")]
FileUtils.rm_r Dir[home(".bundle", "cache", "extensions", "**", "*binary_c*")]
gem_binary_cache.join("very_simple_binary_c.rb").open("w") {|f| f << "puts File.basename(__FILE__)" }
git_binary_cache.join("very_simple_git_binary_c.rb").open("w") {|f| f << "puts File.basename(__FILE__)" }