Close dup'ed fd after using
This commit is contained in:
parent
9387c8919a
commit
b0612f790d
|
@ -17,6 +17,7 @@
|
|||
(Adam Prescott) [Issue #493]
|
||||
* Ensure process exits with correct status code and $! is propagated.
|
||||
(Micah Geisel) [Issue #497]
|
||||
* Close dup'ed fd after using (Dmitry Vorotilin) [Issue #446, #529, #528]
|
||||
|
||||
### 1.5.0 ###
|
||||
|
||||
|
|
|
@ -99,13 +99,13 @@ module Capybara::Poltergeist
|
|||
# it works with JRuby but I've experienced strange mistakes on Rubinius.
|
||||
def redirect_stdout
|
||||
prev = STDOUT.dup
|
||||
prev.autoclose = false
|
||||
$stdout = @write_io
|
||||
STDOUT.reopen(@write_io)
|
||||
yield
|
||||
ensure
|
||||
STDOUT.reopen(prev)
|
||||
$stdout = STDOUT
|
||||
prev.close
|
||||
end
|
||||
|
||||
def kill_phantomjs
|
||||
|
|
Loading…
Reference in New Issue