Sha256: adf01416e62f3ab1341248d7fe8e5d1368ade57636fab6c0d1c678eaa0a3c35c
Contents?: true
Size: 442 Bytes
Versions: 11
Compression:
Stored size: 442 Bytes
Contents
# Provides a utility method withIO() used by several test-cases. Runs # the specified block with stdin and stdout replumbed to the provided # file-handles; the old values of stdin and stdout are passed to the # block, in case they should be needed. def withIO(newin, newout) old_STDIN = $stdin old_STDOUT = $stdout $stdin = newin $stdout = newout yield old_STDIN, old_STDOUT ensure $stdin = old_STDIN $stdout = old_STDOUT end
Version data entries
11 entries across 11 versions & 1 rubygems