mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-02 22:42:49 +08:00
31 lines
633 B
Ruby
31 lines
633 B
Ruby
test_begin "test_load"
|
|
|
|
# assert_equal 'ok', proc{
|
|
# open("require-lock-test.rb", "w") {|f|
|
|
# f.puts "sleep 0.1"
|
|
# f.puts "module M"
|
|
# f.puts "end"
|
|
# }
|
|
# $:.unshift Dir.pwd
|
|
# vs = (1..2).map {|i|
|
|
# Thread.start {
|
|
# require "require-lock-test"
|
|
# M
|
|
# }
|
|
# }.map {|t| t.value }
|
|
# vs[0] == M && vs[1] == M ? :ok : :ng
|
|
# }, '[ruby-dev:32048]'
|
|
|
|
# assert_equal 'ok', proc{
|
|
# %w[a a/foo b].each {|d| Dir.mkdir(d)}
|
|
# open("b/foo", "w") {|f| f.puts "$ok = :ok"}
|
|
# $:.replace(%w[a b])
|
|
# begin
|
|
# load "foo"
|
|
# $ok
|
|
# rescue => e
|
|
# e.message
|
|
# end
|
|
# }, '[ruby-dev:38097]'
|
|
|
|
test_end |