summaryrefslogtreecommitdiffstats
path: root/features/support/helpers/misc_helpers.rb
diff options
context:
space:
mode:
Diffstat (limited to 'features/support/helpers/misc_helpers.rb')
-rw-r--r--features/support/helpers/misc_helpers.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/features/support/helpers/misc_helpers.rb b/features/support/helpers/misc_helpers.rb
index a1ec6fc..9a06c3d 100644
--- a/features/support/helpers/misc_helpers.rb
+++ b/features/support/helpers/misc_helpers.rb
@@ -100,13 +100,14 @@ def convert_from_bytes(size, unit)
return size.to_f/convert_bytes_mod(unit).to_f
end
-def cmd_helper(cmd)
+def cmd_helper(cmd, env = {})
if cmd.instance_of?(Array)
cmd << {:err => [:child, :out]}
elsif cmd.instance_of?(String)
cmd += " 2>&1"
end
- IO.popen(cmd) do |p|
+ env = ENV.to_h.merge(env)
+ IO.popen(env, cmd) do |p|
out = p.readlines.join("\n")
p.close
ret = $?