diff options
author | Benoit Daloze <[email protected]> | 2022-03-03 14:43:14 +0100 |
---|---|---|
committer | Benoit Daloze <[email protected]> | 2022-03-03 14:43:14 +0100 |
commit | 3b21818db1fac0c22f16364eab2d8cc0067abd63 (patch) | |
tree | 6776a6bfe92db4e35da1ff01e09c40d4c4c20351 /spec/ruby/language | |
parent | 1dc6bed0ca6ca379f1c4b2e9fc0dee72dbf1e205 (diff) |
Update to ruby/spec@82cd3a3
Diffstat (limited to 'spec/ruby/language')
-rw-r--r-- | spec/ruby/language/file_spec.rb | 12 | ||||
-rw-r--r-- | spec/ruby/language/predefined_spec.rb | 10 |
2 files changed, 12 insertions, 10 deletions
diff --git a/spec/ruby/language/file_spec.rb b/spec/ruby/language/file_spec.rb index 729dee1008..136b262d07 100644 --- a/spec/ruby/language/file_spec.rb +++ b/spec/ruby/language/file_spec.rb @@ -12,18 +12,10 @@ describe "The __FILE__ pseudo-variable" do end end -describe "The __FILE__ pseudo-variable" do - it_behaves_like :language___FILE__, :require, CodeLoadingSpecs::Method.new -end - -describe "The __FILE__ pseudo-variable" do +describe "The __FILE__ pseudo-variable with require" do it_behaves_like :language___FILE__, :require, Kernel end -describe "The __FILE__ pseudo-variable" do - it_behaves_like :language___FILE__, :load, CodeLoadingSpecs::Method.new -end - -describe "The __FILE__ pseudo-variable" do +describe "The __FILE__ pseudo-variable with load" do it_behaves_like :language___FILE__, :load, Kernel end diff --git a/spec/ruby/language/predefined_spec.rb b/spec/ruby/language/predefined_spec.rb index 732e66b9e7..8eb7511c0e 100644 --- a/spec/ruby/language/predefined_spec.rb +++ b/spec/ruby/language/predefined_spec.rb @@ -835,6 +835,8 @@ describe "Execution variable $:" do it "can be changed via <<" do $: << "foo" $:.should include("foo") + ensure + $:.delete("foo") end it "is read-only" do @@ -850,6 +852,14 @@ describe "Execution variable $:" do $-I = [] }.should raise_error(NameError) end + + it "default $LOAD_PATH entries until sitelibdir included have @gem_prelude_index set" do + $:.should.include?(RbConfig::CONFIG['sitelibdir']) + idx = $:.index(RbConfig::CONFIG['sitelibdir']) + + $:[idx..-1].all? { |p| p.instance_variable_defined?(:@gem_prelude_index) }.should be_true + $:[0...idx].all? { |p| !p.instance_variable_defined?(:@gem_prelude_index) }.should be_true + end end describe "Global variable $\"" do |