Sha256: bb712a28398a8b8884f085296946b9b17526e15f6f0c4fcc2c63fd403b9e14f9
Contents?: true
Size: 519 Bytes
Versions: 11
Compression:
Stored size: 519 Bytes
Contents
# class useful for testing output to stdout class IOString < String def write x self.<< x end def readline! line = slice!(/^.*(\n|$)/) if $1 == "\n" then line.chop! elsif line == "" then nil else line end end def puts( x ) stdout_orig = $stdout $stdout = self Kernel.puts x $stdout = stdout_orig end end module MockStdoutTestCase def setup @mockout = IOString.new "" end def teardown $stdout = STDOUT end end
Version data entries
11 entries across 11 versions & 2 rubygems