From: Chris Sepic Date: 2008-08-31T15:39:06+09:00 Subject: Re: capturing stdout during unit tests > Install the ZenTest gem, then: > > require 'test/zentest_assertions' > > class TestBlah < Test::Unit::TestCase > > def test_my_stuff > out, err = util_capture do the_thing end > assert_equal "...", out.string > assert_equal "...", err.string > end > end if you're not using test/unit: require 'test/zentest_assertions' include Test::Unit::Assertions -- Posted via http://www.ruby-forum.com/.