Skip to content
Permalink
Browse files
Add regression spec for LOADED_FEATURES not expanding symlinks.
  • Loading branch information
headius committed Dec 10, 2014
1 parent 6776f0b commit 4c3fa761c356d635cd06a950e52d6a11689fcaae
Showing with 21 additions and 0 deletions.
  1. +21 −0 spec/regression/GH-1941_loaded_features_does_not_expand_symlinks_spec.rb
@@ -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

0 comments on commit 4c3fa76

Please sign in to comment.