On Wed, Mar 26, 2003 at 09:58:11AM +0900, Gavin Sinclair wrote:
>   def print_list(list, out=STDOUT)
>     list.each_with_index do |item, index|
>       out.print "#{index+1}: #{item}\n"
>     end
>   end
> 
> In your test case:
> 
>   require 'stringio'
> 
>   buf = ""
>   StringIO.open(buf, 'w') do |io|
>     print_list(list, io)
>   end
> 
>   assert_equal(expected_result, buf)

Or you can just do
   $defout = StringIO.open(...)

I think that should let everything work without changes, except putc under
1.6.8 (but then you don't get stringio with 1.6.8 unless you install the
1.6->1.8 shim)

Regards,

Brian.