diff options
author | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-19 15:15:12 +0000 |
---|---|---|
committer | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-11-19 15:15:12 +0000 |
commit | 578e760a8b52f78e55535a4a33d10abe6ee3a8a6 (patch) | |
tree | 09fe9e4651e7cb9cf06ab2ebb7ae652aee758785 | |
parent | a8c358b7046060a007659131c40f973e85b51406 (diff) |
Reorganize Module#autoload to have similar specs next to each other
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | spec/ruby/core/module/autoload_spec.rb | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/spec/ruby/core/module/autoload_spec.rb b/spec/ruby/core/module/autoload_spec.rb index 9116ddf0a9..d7b212183b 100644 --- a/spec/ruby/core/module/autoload_spec.rb +++ b/spec/ruby/core/module/autoload_spec.rb @@ -335,6 +335,22 @@ describe "Module#autoload" do end end + describe "when changing $LOAD_PATH" do + before do + $LOAD_PATH.unshift(File.expand_path('../fixtures/path1', __FILE__)) + end + + after do + $LOAD_PATH.shift + $LOAD_PATH.shift + end + + it "does not reload a file due to a different load path" do + ModuleSpecs::Autoload.autoload :LoadPath, "load_path" + ModuleSpecs::Autoload::LoadPath.loaded.should == :autoload_load_path + end + end + describe "(concurrently)" do it "blocks a second thread while a first is doing the autoload" do ModuleSpecs::Autoload.autoload :Concur, fixture(__FILE__, "autoload_concur.rb") @@ -383,27 +399,7 @@ describe "Module#autoload" do ModuleSpecs::Autoload.send(:remove_const, :Concur) end - end - - describe "when changing $LOAD_PATH" do - - before do - $LOAD_PATH.unshift(File.expand_path('../fixtures/path1', __FILE__)) - end - - after do - $LOAD_PATH.shift - $LOAD_PATH.shift - end - it "does not reload a file due to a different load path" do - ModuleSpecs::Autoload.autoload :LoadPath, "load_path" - ModuleSpecs::Autoload::LoadPath.loaded.should == :autoload_load_path - end - - end - - describe "(concurrently)" do ruby_bug "#10892", ""..."2.3" do it "blocks others threads while doing an autoload" do file_path = fixture(__FILE__, "repeated_concurrent_autoload.rb") |