Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion bundler/spec/support/command_execution.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

module Spec
CommandExecution = Struct.new(:command, :working_directory, :exitstatus, :stdout, :stderr) do
CommandExecution = Struct.new(:command, :working_directory, :exitstatus, :original_stdout, :original_stderr) do
def to_s
"$ #{command}"
end
Expand All @@ -11,6 +11,19 @@ def stdboth
@stdboth ||= [stderr, stdout].join("\n").strip
end

def stdout
original_stdout
end

# Can be removed once/if https://github.com/oneclick/rubyinstaller2/pull/369 is resolved
def stderr
return original_stderr unless Gem.win_platform?

original_stderr.split("\n").reject do |l|
l.include?("operating_system_defaults")
end.join("\n")
end

def to_s_verbose
[
to_s,
Expand Down
4 changes: 2 additions & 2 deletions bundler/spec/support/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ def sys_exec(cmd, options = {})

stdout_read_thread = Thread.new { stdout.read }
stderr_read_thread = Thread.new { stderr.read }
command_execution.stdout = stdout_read_thread.value.strip
command_execution.stderr = stderr_read_thread.value.strip
command_execution.original_stdout = stdout_read_thread.value.strip
command_execution.original_stderr = stderr_read_thread.value.strip

status = wait_thr.value
command_execution.exitstatus = if status.exited?
Expand Down