diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-07 18:39:28 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-07 18:39:28 +0000 |
commit | 37504dc560792ccd3e32d637d2fcaf5f0ac0a1ca (patch) | |
tree | b96ae47f8fe939bb59cf6b3d9f89132ac9261934 /bootstraptest/test_autoload.rb | |
parent | 0c8bc11d3d21611e996f3ed11493e984c22a3f18 (diff) |
* 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
Diffstat (limited to 'bootstraptest/test_autoload.rb')
-rw-r--r-- | bootstraptest/test_autoload.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/bootstraptest/test_autoload.rb b/bootstraptest/test_autoload.rb new file mode 100644 index 0000000000..395f1bd7e3 --- /dev/null +++ b/bootstraptest/test_autoload.rb @@ -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 +} |