commit 6d1c13c52e17c5995bd71f08ade578420b4d6fea
parent 61ae2d15fe7449863893666faa4068307e477df4
Author: Daniel Barlow <dan@telent.net>
Date: Wed, 11 Aug 2021 17:59:55 +0100
capture stderr when running shell commands in tests
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/features/step_definitions/steps.rb b/features/step_definitions/steps.rb
@@ -4,7 +4,7 @@ require 'tmpdir'
require 'fileutils'
def shell(s)
- output = IO.popen(["bash", "-c", s]) do |f| f.read end
+ output = IO.popen(["bash", "-c", s], "r", 2 => 1) do |f| f.read end
$?.exitstatus.zero? or raise "#{$?} : #{@i_see}"
output
end