Commit f091fc2
committed
Use Zeitwerk::Registry to unload loaders in tests
Previously I enabled ObjectSpace in JRuby in zeitwerk_helpers.rb
programatically, but it did not fully work.
ObjectSpace.each_object(Zeitwerk::Loader) kept returning empty list. I
suppose this was because the ObjectSpace was enabled too late. It worked
correctly when JRUBY_OPTS="-X+O" wever passed in the command line.
However, because the CI config is set via repo automation, it was hard
to configure it just for dry-systems and would have a performance
penalty if we enabled it for all gems.
So instead, I figured out a way to drop usage of ObjectSpace in favour
of Zeitwer's Registry module, which does the same thing (presumably even
better).1 parent 8d0bfab commit f091fc2
1 file changed
+1
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | 3 | | |
9 | 4 | | |
10 | | - | |
| 5 | + | |
11 | 6 | | |
12 | 7 | | |
13 | 8 | | |
| |||
0 commit comments