Skip to content

Add spec for require after $LOAD_PATH change #1881

Merged
merged 3 commits into from Apr 26, 2013
View
7 spec/ruby/core/kernel/shared/require.rb
@@ -173,6 +173,13 @@
ScratchPad.recorded.should == [:loaded]
end
+ it "does not load file twice after $LOAD_PATH change" do
+ $LOAD_PATH << CODE_LOADING_DIR
+ @object.send(@method, "load_fixture.rb").should be_true
+ $LOAD_PATH.unshift CODE_LOADING_DIR + "/gem"
+ @object.send(@method, "load_fixture.rb").should be_false
+ end
+
it "does not resolve a ./ relative path against $LOAD_PATH entries" do
$LOAD_PATH << CODE_LOADING_DIR
lambda do
View
1 spec/ruby/fixtures/code/gem/load_fixture.rb
@@ -0,0 +1 @@
+ScratchPad << :loaded
View
2 spec/tags/18/ruby/core/kernel/load_tags.txt
@@ -0,0 +1,2 @@
+fails:Kernel#load (path resolution) does not load file twice after $LOAD_PATH change
+fails:Kernel.load (path resolution) does not load file twice after $LOAD_PATH change
View
2 spec/tags/19/ruby/core/kernel/load_tags.txt
@@ -0,0 +1,2 @@
+fails:Kernel#load (path resolution) does not load file twice after $LOAD_PATH change
+fails:Kernel.load (path resolution) does not load file twice after $LOAD_PATH change
View
2 spec/tags/19/ruby/core/kernel/require_tags.txt
@@ -0,0 +1,2 @@
+fails:Kernel#require (path resolution) does not load file twice after $LOAD_PATH change
+fails:Kernel.require (path resolution) does not load file twice after $LOAD_PATH change
Something went wrong with that request. Please try again.