summaryrefslogtreecommitdiff
path: root/bootstraptest/test_autoload.rb
diff options
context:
space:
mode:
Diffstat (limited to 'bootstraptest/test_autoload.rb')
-rw-r--r--bootstraptest/test_autoload.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/bootstraptest/test_autoload.rb b/bootstraptest/test_autoload.rb
index 05376df2204..048256170ea 100644
--- a/bootstraptest/test_autoload.rb
+++ b/bootstraptest/test_autoload.rb
@@ -50,3 +50,12 @@ assert_equal 'ok', %q{
module M; end
Thread.new{eval('$SAFE=4; ZZZ.new.hoge')}.value
}
+
+assert_equal 'okok', %q{
+ open("zzz.rb", "w") {|f| f.puts "class ZZZ; def self.ok;:ok;end;end"}
+ autoload :ZZZ, "./zzz.rb"
+ t1 = Thread.new {ZZZ.ok}
+ t2 = Thread.new {ZZZ.ok}
+ [t1.value, t2.value].join
+}
+