summaryrefslogtreecommitdiff
path: root/spec/support
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support')
-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