[rspec-users] Inspect STDERR in a story

Ashley Moran ashley.moran at patchspace.co.uk
Sat Apr 12 04:54:53 EDT 2008


Hi

I have a story step that looks like this:

   When /(the user|then) runs "migrate (.*)"/ do |_, args|
     cd project_dir do
       @output = `#{migrate} #{args}`
     end
       @output_lines = @output.split("\n")
   end

Which is fine for testing STDOUT but not STDERR.  I don't want to  
redirect STDERR to STDOUT because then the story can't prove that  
error messages are displayed separately (although the specs would)

Any hints? :)

Thanks
Ashley

-- 
http://www.patchspace.co.uk/
http://aviewfromafar.net/





More information about the rspec-users mailing list