Skip to content

Commit

Permalink
Add regression spec for LOADED_FEATURES not expanding symlinks.
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Dec 10, 2014
1 parent 6776f0b commit 4c3fa76
Showing 1 changed file with 21 additions and 0 deletions.
@@ -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.