diff options
author | Jean Boussier <jean.boussier@gmail.com> | 2019-05-07 12:52:24 +0200 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2019-06-21 18:21:45 +0200 |
commit | e5e811e4a04482a5ad764fbb2b792ee5fbdd7195 (patch) | |
tree | dfbe6582a8361d18bb53b6efd642790b046e00bf /spec/ruby | |
parent | 2f2fc939eb13af9baa325f154872f60cdeff973c (diff) | |
download | ruby-e5e811e4a04482a5ad764fbb2b792ee5fbdd7195.tar.gz |
Add extra spec from https://github.com/ruby/ruby/pull/2173
Diffstat (limited to 'spec/ruby')
-rw-r--r-- | spec/ruby/core/module/autoload_spec.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/ruby/core/module/autoload_spec.rb b/spec/ruby/core/module/autoload_spec.rb index 09fbafd51c..e737d3a3df 100644 --- a/spec/ruby/core/module/autoload_spec.rb +++ b/spec/ruby/core/module/autoload_spec.rb @@ -22,6 +22,11 @@ describe "Module#autoload?" do ModuleSpecs::Autoload::Parent.autoload :AnotherAutoload, "another_autoload.rb" ModuleSpecs::Autoload::Child.autoload?(:AnotherAutoload, false).should be_nil end + + it "returns the name of the file that will be loaded if recursion is disabled but the autoload is defined on the classs itself" do + ModuleSpecs::Autoload::Child.autoload :AnotherAutoload, "another_autoload.rb" + ModuleSpecs::Autoload::Child.autoload?(:AnotherAutoload, false).should == "another_autoload.rb" + end end end |