Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(test): Ensure
$stdout
is always restored
This fixes the `IOError` we could encounter in tests. Found using: ```ruby def bugmsg(header, stdout) bugged = begin; print; rescue IOError; "💥 "; end STDOUT.puts "🤞#{header.rjust(17)}: stdout=#{stdout.inspect} " \ "#{bugged}(at #{caller_locations(2, 1).first})" end trace_var :$stdout, (proc { bugmsg("$stdout=", _1) }) TracePoint.trace(:a_return) do |tp| next unless tp.method_id == :reopen && tp.self == $stdout bugmsg("$stdout#reopen", $stdout) end ```
- Loading branch information