Skip to content

Commit 4606a5c

Browse files
committed
Fix syntax for Ruby 2.4
1 parent 34204bc commit 4606a5c

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

test/helper/with_term.rb

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ def sio.tty?; true; end if tty
1414

1515
def with_term(tty=true)
1616
with_sio(tty: tty) do |sio|
17-
orig_stdout, $stdout = $stdout, sio
18-
orig_env = ENV.to_h.dup
19-
ENV['TERM'] = 'xterm-256color'
20-
yield
21-
ensure
22-
$stdout = orig_stdout
23-
ENV.replace(orig_env) if orig_env
17+
begin
18+
orig_stdout, $stdout = $stdout, sio
19+
orig_env = ENV.to_h.dup
20+
ENV['TERM'] = 'xterm-256color'
21+
yield
22+
ensure
23+
$stdout = orig_stdout
24+
ENV.replace(orig_env) if orig_env
25+
end
2426
end
2527
end
2628
end

0 commit comments

Comments
 (0)