From 0aab64eaff3e8615a4156e1aab52c7ced422d15e Mon Sep 17 00:00:00 2001 From: Patrick Mahoney Date: Wed, 1 Feb 2012 21:45:54 -0600 Subject: [PATCH] Skip Semaphore#value test on Mac OS X where it is unsupported. --- spec/process_shared/semaphore_spec.rb | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/spec/process_shared/semaphore_spec.rb b/spec/process_shared/semaphore_spec.rb index 3332a8e..2cf50ec 100644 --- a/spec/process_shared/semaphore_spec.rb +++ b/spec/process_shared/semaphore_spec.rb @@ -58,16 +58,18 @@ module ProcessShared end describe '#post and #wait' do - it 'increments and decrements the value' do - Semaphore.open(0) do |sem| - 10.times do |i| - sem.post - sem.value.must_equal(i + 1) - end + unless FFI::Platform.mac? + it 'increments and decrements the value' do + Semaphore.open(0) do |sem| + 10.times do |i| + sem.post + sem.value.must_equal(i + 1) + end - 10.times do |i| - sem.wait - sem.value.must_equal(10 - i - 1) + 10.times do |i| + sem.wait + sem.value.must_equal(10 - i - 1) + end end end end