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

Forum statistics

Threads
473,982
Messages
2,570,189
Members
46,734
Latest member
manin

Latest Threads

Top