Skip to content

Commit c0609e0

Browse files
committed
Fix all_stdlibs test to use the installed home
1 parent 7fdf1fa commit c0609e0

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

test/truffle/integration/no_extra_output/all_stdlibs.rb

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,30 @@
66
# GNU General Public License version 2, or
77
# GNU Lesser General Public License version 2.1.
88

9+
require 'rbconfig'
10+
911
def glob(pattern)
1012
files = Dir.glob(pattern)
1113
raise "no libraries found with #{pattern}" if files.empty?
1214
files
1315
end
1416

15-
stdlibs = glob('lib/mri/*.{rb,su}').map { |file|
16-
File.basename(file, '.*')
17+
stdlibs = []
18+
19+
glob("#{RbConfig::CONFIG['rubylibdir']}/*.rb").each { |file|
20+
stdlibs << File.basename(file, '.*')
21+
}
22+
23+
glob("#{RbConfig::CONFIG['archdir']}/*.su").each { |file|
24+
stdlibs << File.basename(file, '.*')
1725
}
1826

19-
glob('lib/truffle/*.rb').map { |file|
27+
glob("#{RbConfig::CONFIG['prefix']}/lib/truffle/*.rb").each { |file|
2028
stdlibs << File.basename(file, '.*')
2129
}
2230

23-
glob('lib/mri/net/*.rb').map { |file| File.basename(file, '.*') }.each { |file|
24-
stdlibs << "net/#{file}"
31+
glob("#{RbConfig::CONFIG['rubylibdir']}/net/*.rb").each { |file|
32+
stdlibs << "net/#{File.basename(file, '.*')}"
2533
}
2634

2735
stdlibs += %w[json]

0 commit comments

Comments
 (0)