Skip to content

Commit

Permalink
Restore output silencing spec helper
Browse files Browse the repository at this point in the history
  • Loading branch information
elia committed Sep 30, 2013
1 parent 3c5cb19 commit c5cdbce
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions spec/spec_helper.rb
Expand Up @@ -226,12 +226,14 @@ def did_finish

module OutputSilencer
def silence_stdout
original_puts = `Opal.puts`
original_stdout = $stdout
new_stdout = Object.new
`#{new_stdout}.$puts = function(){}`
begin
`Opal.puts = function(){}`
$stdout = new_stdout
yield
ensure
`Opal.puts = #{original_puts}`
$stdout = original_stdout
end
end
end
Expand Down

0 comments on commit c5cdbce

Please sign in to comment.