summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSutou Kouhei <kou@clear-code.com>2019-12-31 01:19:37 +0900
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-12-31 10:51:10 +0100
commit026e63329132083677fe6015ded6b54270b94121 (patch)
tree3917e0be4d217a1617d99f1a6008634a12a2993f
parent984bef1771b63d174db68016fb4e135f0526ec5d (diff)
downloadbundler-026e63329132083677fe6015ded6b54270b94121.tar.gz
Fix rspec stuck problem for large stderr external command
-rw-r--r--spec/support/helpers.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb
index 7d1bd65185..e9c9e766cf 100644
--- a/spec/support/helpers.rb
+++ b/spec/support/helpers.rb
@@ -210,8 +210,10 @@ module Spec
yield stdin, stdout, wait_thr if block_given?
stdin.close
- command_execution.stdout = Thread.new { stdout.read }.value.strip
- command_execution.stderr = Thread.new { stderr.read }.value.strip
+ 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.exitstatus = wait_thr && wait_thr.value.exitstatus
end