mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
16 lines
325 B
Ruby
16 lines
325 B
Ruby
|
assert_equal 'ok', %q{
|
||
|
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]'
|