1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
This commit is contained in:
Benoit Daloze 2020-10-24 15:52:37 +02:00
parent 342fbae83c
commit 148961adcd
47 changed files with 725 additions and 61 deletions

View file

@ -160,6 +160,14 @@ describe :kernel_require_basic, shared: true do
ScratchPad.recorded.should == [:loaded]
end
it "accepts an Object with #to_path in $LOAD_PATH" do
obj = mock("to_path")
obj.should_receive(:to_path).at_least(:once).and_return(CODE_LOADING_DIR)
$LOAD_PATH << obj
@object.send(@method, "load_fixture.rb").should be_true
ScratchPad.recorded.should == [:loaded]
end
it "does not require file twice after $LOAD_PATH change" do
$LOAD_PATH << CODE_LOADING_DIR
@object.require("load_fixture.rb").should be_true