Re: [rspec-users] Inspect STDERR in a story

2008-04-14 Thread Ashley Moran
On 14 Apr 2008, at 14:36, Edvard Majakari wrote: > ..because you're likely smart enough to avoid using file as a > temporary variable whenever possible :) Ha, I don't know... I haven't checked Daily WTF lately to see if any of my code has made it on there :) > First off, using the method sim

Re: [rspec-users] Inspect STDERR in a story

2008-04-14 Thread Edvard Majakari
On Sat, Apr 12, 2008 at 4:17 PM, Ashley Moran <[EMAIL PROTECTED]> wrote: > Yeah! Don't know why I didn't think of just sending stderr to a log > file myself... ..because you're likely smart enough to avoid using file as a temporary variable whenever possible :) First off, using the method sim

Re: [rspec-users] Inspect STDERR in a story

2008-04-12 Thread Ashley Moran
On 12 Apr 2008, at 11:51, Edvard Majakari wrote: > How about something along the lines > > cd project_dir do > @stdout, @stdterr = capture_outputs("#{migrate} #{args}") > end > > ... > def capture_outputs(cmd) > stderr_log = "/tmp" + "/#{$0}-{$$}.log" > out = `cmd 2> #{stderr_log}

Re: [rspec-users] Inspect STDERR in a story

2008-04-12 Thread Edvard Majakari
On Sat, Apr 12, 2008 at 11:54 AM, Ashley Moran <[EMAIL PROTECTED]> wrote: > 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.s

[rspec-users] Inspect STDERR in a story

2008-04-12 Thread Ashley Moran
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 redi