From: Simon Strandgaard Date: 2004-02-17T01:09:55+09:00 Subject: Re: `close': Bad file descriptor - filename (Errno::EBADF) On Mon, 16 Feb 2004 22:51:36 +0900, Yukihiro Matsumoto wrote: > on 04/02/16, Simon Strandgaard writes: > > |While upgrading rubicon from 1.6 to 1.8, I bumped into > |this problem in the builtin/TestIO.rb file. > |http://rubyforge.org/cgi-bin/viewcvs/cgi/viewcvs.cgi/rubicon/builtin/TestIO.rb?cvsroot=rubytests > > It's a bug in rubicon. Try test suites bundled with 1.8.1 or later. [snip code] > Chad Fowler and I are working on upgrading rubicon for ruby-1.8.1. We have made a transition from rubyunit to now use testunit. I am working with the CVS version (I don't think there is a newer rubicon suite?) ;-) You can see the pending bugs here: http://rubyforge.org/tracker/?func=browse&group_id=179&atid=751 Please comment on these :-) The code which I am looking at is def test_LSHIFT # '<<' File.open(@file, "w") do |file| io = IO.new(file.fileno, "w") io << 1 << "\n" << Dummy.new << "\n" << "cat\n" io.close end expected = [ "1\n", "dummy\n", "cat\n"] IO.foreach(@file) do |line| assert_equal(expected.shift, line) end assert_equal([], expected) end Why make an instance of the IO class, when its the '<<' leftshift operator we want to test? -- Simon Strandgaard