Skip Semaphore#value test on Mac OS X where it is unsupported.

This commit is contained in:
Patrick Mahoney 2012-02-01 21:45:54 -06:00
parent 60b1cd8e53
commit 0aab64eaff
1 changed files with 11 additions and 9 deletions

View File

@ -58,16 +58,18 @@ module ProcessShared
end end
describe '#post and #wait' do describe '#post and #wait' do
it 'increments and decrements the value' do unless FFI::Platform.mac?
Semaphore.open(0) do |sem| it 'increments and decrements the value' do
10.times do |i| Semaphore.open(0) do |sem|
sem.post 10.times do |i|
sem.value.must_equal(i + 1) sem.post
end sem.value.must_equal(i + 1)
end
10.times do |i| 10.times do |i|
sem.wait sem.wait
sem.value.must_equal(10 - i - 1) sem.value.must_equal(10 - i - 1)
end
end end
end end
end end