Testing command-line apps with Cucumber: advice?

J

James Coglan

[Note: parts of this message were removed to make it a legal post.]

Hi all,

I'd like to write some Cucumber features for a command-line app I'm working
on (specifically, http://github.com/jcoglan/claw). The app runs a Readline
loop taking user input, and uses this input to search for and open files by
running shell commands (grep, gedit, firefox etc.). Right now it's using
#puts and the backtick (`) method for output and shell commands, and I'm not
sure how to go about testing the app's output. Do I mock Kernel#puts, should
I give the app an IO object to write output to so I can collect it, or
soemthing else entirely?

If anyone has advice about how to structure this I'd be most grateful.

Cheers,
James
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top