Martin DeMello
7/18/2007 6:39:00 PM
On 7/18/07, Kazushi Sakuraba <rubyoncrack@dodgeit.com> wrote:
> This is a shot in the dark since it appears nobody uses expect.rb.
>
> Does anybody know how to use a conditional with IO.expect("")?
>
> Everytime I enter a string that isn't expected into IO.expect(""), the
> script just hangs and I can't do anything with the failure.
Can you post your script? I believe the point of expect is to just
keep accepting input till it gets the "expected" value - try entering
the right string after you enter the wrong one. Here's a sample
interaction with expect - I'm assuming ruby expect follows the same
behaviour:
martin@dabba ~ $ cat hi.exp
set timeout -1
expect "hello world\n"
send "we get signal!\n"
martin@dabba ~ $ expect hi.exp
how are you gentlemen?
somebody set up us the bomb
move zig!!!!!!
hello world
we get signal!
martin@dabba ~ $
martin