I’m trying to write tests for some code which creates a REPL mode and having a lot of trouble. to test the code I’d like to have a function that allows me to send a string to Base.active_repl
and then returns the string that the REPL would normally print as the output. ie.
send_to_repl!(';')
send_to_repl("echo hi") == "hi"
is there any way to do this?