From: Eero Saynatkari Date: 2006-08-28T07:20:35+09:00 Subject: Re: Readline and StringIO Eero Saynatkari wrote: > Robert Klemme wrote: >> Eero Saynatkari wrote: >>> It is currently not possible to substitute $stdout or >>> $stdin with a StringIO when using the Readline library >>> ($stderr seems to be fine) due to a T_FILE check in >>> readline.c. >>> >>> Can someone come up with a reason why this might be >>> required before I change it and submit a patch? >>> >>> While I am at it, I suppose I will try to provide an >>> additional method for getting the full line of input. >> >> Um, I don't understand why you would want to do that. You are talking >> about GNU readline, aren't you? AFAIK this lib is for interactive >> editing input - something you cannot do with a StringIO anyway. Did I >> miss something? > > Unit-testing a program that is supposed to be > interactive. StringIO can would be a fairly simple > way of providing specific input and being able to > predict the output. This is possible with files as > well, if a bit less wieldy :) Come to think of it, might make such input redirection possible in irb also (if using --readline). >> Kind regards >> >> robert -- Posted via http://www.ruby-forum.com/.