Add spec for require after $LOAD_PATH change #1881
dbussink merged 3 commits into rubinius:master from unknown repository
Apr 26, 2013
Commits on Mar 29, 2013
Aug 31, 2012
When developer add something to $LOAD_PATH and require once again the same file ruby should not require it once again. Example: Rubinius have lib/racc/parser.rb file. And this file will require after bootstrap. require 'racc/parser' After require 'rubygems' $LOAD_PATH will change and now we have access to two version on 'racc/parser' (from Rubinius /lib and /gems/racc). When user try to require once again rubinius will search via $LOAD_PATH and hit racc/parser from _RUBYGEMS_. In ruby 1.9 mode all paths are expanded so rubinius will require once again 'racc/parser'. This is because in $LOADED_FEATURES we can find only "[rubinius_path]/lib/racc/parser.rb". When CodeLoader will find file in $LOAD_PATH ([rubygems]/racc/parser.rb) and full path is not part of $LOADED_FEATURES this file will be load once again.
Commits on Apr 26, 2013