From e3d05001edf0326b24a06f0ec6cdc156663e3bf0 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Tue, 25 Apr 2023 17:08:52 +0200 Subject: [PATCH] Workaround CRuby adding x86_64-linux-fake in $LOADED_FEATURES --- spec/ruby/core/kernel/require_spec.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spec/ruby/core/kernel/require_spec.rb b/spec/ruby/core/kernel/require_spec.rb index b0af8b297d..76f6c381db 100644 --- a/spec/ruby/core/kernel/require_spec.rb +++ b/spec/ruby/core/kernel/require_spec.rb @@ -24,7 +24,11 @@ describe "Kernel#require" do it "#{provided.join(', ')} are already required" do out = ruby_exe("puts $LOADED_FEATURES", options: '--disable-gems --disable-did-you-mean') features = out.lines.map { |line| File.basename(line.chomp, '.*') } - features -= %w[encdb transdb] # Ignore CRuby internals + + # Ignore CRuby internals + features -= %w[encdb transdb] + features.reject! { |feature| feature.end_with?('-fake') } + features.sort.should == provided.sort code = provided.map { |f| "puts require #{f.inspect}\n" }.join