diff options
Diffstat (limited to 'bootstraptest/test_autoload.rb')
-rw-r--r-- | bootstraptest/test_autoload.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/bootstraptest/test_autoload.rb b/bootstraptest/test_autoload.rb index 05376df220..048256170e 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 +} + |