Sha256: 24c1f1616c55445da2c4ea368c9f461deeb91cfffcb34d62a3bda233bc108f98
Contents?: true
Size: 475 Bytes
Versions: 18
Compression:
Stored size: 475 Bytes
Contents
module Lolcommits module TestHelpers module FakeIO # stdout captured and returned # stdin mapped to inputs an IO stream seperated with enter key presses def fake_io_capture(inputs: []) input_stream = "#{inputs.join("\r\n")}\r\n" $stdin = StringIO.new(input_stream) $stdout = StringIO.new yield $stdout.string ensure $stdin = STDIN $stdout = STDOUT end end end end
Version data entries
18 entries across 18 versions & 1 rubygems