mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* load.c (rb_provided): check expanded path for relative path
features, loading or loaded features are already expanded in 1.9. * variable.c (rb_autoload_load): no needs to check if provided before rb_require_safe. [ruby-dev:34266] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0c8bc11d3d
commit
37504dc560
5 changed files with 45 additions and 6 deletions
25
bootstraptest/test_autoload.rb
Normal file
25
bootstraptest/test_autoload.rb
Normal file
|
@ -0,0 +1,25 @@
|
|||
assert_equal 'ok', %q{
|
||||
open("zzz.rb", "w") {|f| f.puts "class ZZZ; def self.ok;:ok;end;end"}
|
||||
autoload :ZZZ, "./zzz.rb"
|
||||
print ZZZ.ok
|
||||
}
|
||||
|
||||
assert_equal 'ok', %q{
|
||||
open("zzz.rb", "w") {|f| f.puts "class ZZZ; def self.ok;:ok;end;end"}
|
||||
autoload :ZZZ, "./zzz.rb"
|
||||
require "./zzz.rb"
|
||||
print ZZZ.ok
|
||||
}
|
||||
|
||||
assert_equal 'ok', %q{
|
||||
open("zzz.rb", "w") {|f| f.puts "class ZZZ; def self.ok;:ok;end;end"}
|
||||
autoload :ZZZ, "./zzz.rb"
|
||||
print proc{$SAFE=4; ZZZ.ok}.call
|
||||
}
|
||||
|
||||
assert_equal 'ok', %q{
|
||||
open("zzz.rb", "w") {|f| f.puts "class ZZZ; def self.ok;:ok;end;end"}
|
||||
autoload :ZZZ, "./zzz.rb"
|
||||
require "./zzz.rb"
|
||||
print proc{$SAFE=4; ZZZ.ok}.call
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue