File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -5,8 +5,6 @@ module ArubaExt
5
5
def run_command ( cmd , timeout = nil )
6
6
exec_cmd = cmd =~ /^rspec/ ? "bin/#{ cmd } " : cmd
7
7
unset_bundler_env_vars
8
- delete_environment_variable "BUNDLER_VERSION"
9
- delete_environment_variable "RUBYLIB"
10
8
# Ensure the correct Gemfile and binstubs are found
11
9
in_current_directory do
12
10
with_unbundled_env do
@@ -15,6 +13,17 @@ def run_command(cmd, timeout = nil)
15
13
end
16
14
end
17
15
16
+ def unset_bundler_env_vars
17
+ empty_env = with_environment { with_unbundled_env { ENV . to_h } }
18
+ aruba_env = aruba . environment . to_h
19
+ ( aruba_env . keys - empty_env . keys ) . each do |key |
20
+ delete_environment_variable key
21
+ end
22
+ empty_env . each do |k , v |
23
+ set_environment_variable k , v
24
+ end
25
+ end
26
+
18
27
def with_unbundled_env
19
28
if Bundler . respond_to? ( :with_unbundled_env )
20
29
Bundler . with_unbundled_env { yield }
You can’t perform that action at this time.
0 commit comments