From: Eric Boucher Date: 2006-09-09T04:29:53+09:00 Subject: Unit test an output with puts Hi, I want to be able to unit/test an output with the method 'puts'. Here's a small example of what I'm trying to achieve: #-------8<-------- class Foo def output puts "bar" end end #-------8<-------- ...and in my test #-------8<-------- require 'unit/test' ... def test_output myFoo = Foo.new assert_equal("bar", myFoo.output) end #-------8<-------- The problem is that the 'puts' method returns nil and I don't know how to catch the output. Thanks in advance. -- Posted with http://DevLists.com. Sign up and save your mailbox.