Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Add regression spec for LOADED_FEATURES not expanding symlinks.
- Loading branch information
Showing
with
21 additions
and 0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,21 @@ | ||
unless RbConfig::CONFIG['host_os'] == 'mswin32' | ||
require 'tempfile' | ||
require 'fileutils' | ||
|
||
describe "Paths added to $LOADED_FEATURES by require" do | ||
it "do not expand symlinks" do | ||
begin | ||
dir = "GH1941" | ||
Dir.mkdir(dir) | ||
File.symlink(dir, dir + ".link") | ||
file = File.open("GH1941/test.rb", "w") | ||
|
||
expect($LOADED_FEATURES.inspect["GH1941"]).to eq(nil) | ||
ensure | ||
file.close rescue nil | ||
FileUtils.rm_rf(dir) rescue nil | ||
FileUtils.rm_rf(dir + ".link") rescue nil | ||
end | ||
end | ||
end | ||
end |