Skip to content

Commit

Permalink
modifying no_stdout and no_stderr to recover from exceptions raised b…
Browse files Browse the repository at this point in the history
…y a yielded block.
  • Loading branch information
gordoncww committed Dec 4, 2008
1 parent 23a363f commit 7043cb6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/helper.rb
Expand Up @@ -94,13 +94,15 @@ def no_stdout
old_stdout = $stdout.dup
$stdout.reopen(File.open((PLATFORM =~ /mswin/ ? "NUL" : "/dev/null"), 'w'))
yield
ensure
$stdout.reopen(old_stdout)
end

def no_stderr
old_stderr = $stderr.dup
$stderr.reopen(File.open((PLATFORM =~ /mswin/ ? "NUL" : "/dev/null"), 'w'))
yield
ensure
$stderr.reopen(old_stderr)
end

Expand Down

0 comments on commit 7043cb6

Please sign in to comment.