Sha256: 36d95a79231618a009a2395a318f43324fe1dd5cc62477c80692b278d9fa2e27
Contents?: true
Size: 478 Bytes
Versions: 68
Compression:
Stored size: 478 Bytes
Contents
require File.join(File.expand_path(File.dirname(__FILE__)), '../..', 'test_helper.rb') require 'rbbt/util/semaphore' class TestRbbtSemaphore < Test::Unit::TestCase def test_thread times = 50 TmpFile.with_file do |dir| Path.setup(dir) FileUtils.mkdir_p dir RbbtSemaphore.thread_each_on_semaphore((1..times).to_a, 25){|elem| sleep rand Open.write(dir[elem], "test") } assert_equal times, dir.glob.length end end end
Version data entries
68 entries across 68 versions & 1 rubygems