Update behavior of require_relative#1794
Update behavior of require_relative#1794dbussink merged 2 commits intorubinius:masterfrom LTe:require_relative_base_path
Conversation
|
There is a much better way to spec this behavior by looking at what the external behavior is and not by speccing the internal implementation of how the code loader works. If you run this in a file: eval("require_relative './file'") You'll see it will fail the same message. You should be able to use this as a basis for a rubyspec instead of this Rubinius specific spec. |
|
Can you modify it in such a way that the original specs aren't added and then removed? Right now there is a commit that modifies files in both spec/ruby and another directory, which makes merging to rubyspec harder. We also like to keep our history clean, so that's another reason to have a nice and clean pull request. |
There was a problem hiding this comment.
Please do not spec the exact error message. We don't enforce them to have the exact same wording, so we don't want to spec the content either then.
|
Neat! I guess I missed this in my original implementation. :( |
|
@steveklabnik http://donttreadonme.co.uk/rubinius/2011/10/13.html#message_20 so close :) |
|
Hmm, maybe I wasn't too clear before. Since this also adds a rubyspec, could you separate it into two commits, one containing the changes to Rubinius, the other the changes to Rubyspec? |
Update behavior of require_relative
Ruby MRI raise LoadError with message 'cannot infer basepath from (file)'
when developer try to require_relative in 'irb'.
MRI
Rubinius before patch
Rubinius after patch