Testing command-line apps with Cucumber: advice?

  • Follow


[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


-- 
James Coglan
http://jcoglan.com

0
Reply jcoglan (199) 10/3/2009 10:01:28 AM


0 Replies
18 Views

(page loaded in 0.145 seconds)


Reply: