[Shards-general] [PATCH 0/3] implement IO.writev method

Eric Wong normalperson at yhbt.net
Mon Mar 15 00:09:45 EDT 2010


Daniel Berger <djberg96 at gmail.com> wrote:
> One test failure on OS X. Bad code or bad/missing test?
> 
> 7) Error:
> test_writev_retry(TC_IO_Extra):
> LocalJumpError: no block given
>     ./test/test_io_extra.rb:128:in `times'
>     ./test/test_io_extra.rb:128:in `test_writev_retry'
>     ./test/test_io_extra.rb:124:in `each'
>     ./test/test_io_extra.rb:124:in `test_writev_retry'
>     ./test/test_io_extra.rb:123:in `each'
>     ./test/test_io_extra.rb:123:in `test_writev_retry'

Hi, is this Ruby 1.8.6?  Just pushed this out which should fix things:

>From f839db34f01c941eacd7b00dbb171a00791d3c2f Mon Sep 17 00:00:00 2001
From: Eric Wong <normalperson at yhbt.net>
Date: Sun, 14 Mar 2010 21:05:58 -0700
Subject: [PATCH] fix test to run under MRI 1.8.6

integer.times.map doesn't appear to work in 1.8.6,
so replace it with a range which works for all Ruby
versions.
---
 test/test_io_extra.rb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/test/test_io_extra.rb b/test/test_io_extra.rb
index 3e35850..3cd92d4 100644
--- a/test/test_io_extra.rb
+++ b/test/test_io_extra.rb
@@ -125,7 +125,7 @@ class TC_IO_Extra < Test::Unit::TestCase
             rd, wr = IO.pipe
             wr.nonblock = nonblock
             buf = File.open("/dev/urandom", "rb") { |fp| fp.sysread(bs) }
-            vec = count.times.map { buf }
+            vec = (1..count).map { buf }
             pid = fork do
                wr.close
                tmp = []
-- 
Eric Wong


More information about the shards-general mailing list