Is there an Expect equivalent gem for Ruby?

Ruby comes with the PTY module for setting up pseudoterminals to drive interactive command line applications. With it comes an expect method that allows you to interact with an application kinda like Expect. For learning how to use expect, I found “What to expect from the Ruby expect library?” helpful.

As far as gems go, maybe checkout greenletters which is supposed to improve upon PTY + expect (although I haven’t tried it myself).

Leave a Comment