Workaround CRuby adding x86_64-linux-fake in $LOADED_FEATURES

This commit is contained in:
Benoit Daloze 2023-04-25 17:08:52 +02:00
Родитель d562663e40
Коммит e3d05001ed
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -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