Bug #71

Wanted: specs for load/require and __FILE__/backtrace

Added by Charles Nutter 40 days ago. Updated 40 days ago.

Status :New Start :10/10/2008
Priority :Normal Due date :
Assigned to :- % Done :

0%

Category :-
Target version :-

Description

It seems we're a little slim on tests/specs for what FILE should
actually resolve to with various combinations of load/require, load path
structure, and required/loaded feature structure. Some of the cases
are rather interesting, like the fact that -rfoo adds to the load path a
relative "foo" directory that's subject to Dir.chdir.

I've started to at least document the cases in a JRuby bug here:

http://jira.codehaus.org/browse/JRUBY-2909

Obviously we need to codify these, and I'm not sure I'll have time to
look into it. In my final set of examples there I also mention a few
other cases; basically we need all permutations of "oddities" in load
path entries, literal required resource name, load/require, and anything
else you can think of.

The goal with such specs would be to make sure FILE, backtraces,
trace_funcs, and so on are reporting the appropriate pathing. And before
you say this is implementation-specific, I'll remind you of the
relative-pathing logic above, where chdir can change what's actually
loaded. So at the very least there's real live behavioral issues
involved in at least some of the permutations, and we can't know about
them until we spec them all.

History

10/10/2008 10:43 PM - Charles Nutter

I've moved all relevant entries from that bug and a few others here:

http://jira.codehaus.org/browse/JRUBY-3048

Obviously there's pieces that are JRuby-specific, like loading out of
archives, loading from URLs, loading .class (precompiled) versus .rb
(uncompiled), and so on...but the bulk of it is general-purpose.

Also available in: Atom PDF