espressif_tinyusb/test/unit-test/vendor/ceedling/lib/ceedling/stream_wrapper.rb

29 lines
382 B
Ruby

class StreamWrapper
def stdout_override(&fnc)
@stdout_overide_fnc = fnc
end
def stdout_puts(string)
if @stdout_overide_fnc
@stdout_overide_fnc.call(string)
else
$stdout.puts(string)
end
end
def stdout_flush
$stdout.flush
end
def stderr_puts(string)
$stderr.puts(string)
end
def stderr_flush
$stderr.flush
end
end