Sha256: ef91ca0f30123ebe2cf8bc526df90c588f82a44156e489b07a03ef32943fc82c
Contents?: true
Size: 506 Bytes
Versions: 17
Compression:
Stored size: 506 Bytes
Contents
# frozen_string_literal: true 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
17 entries across 17 versions & 1 rubygems