We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
to_h
1 parent 57a5ce4 commit 7550b34Copy full SHA for 7550b34
features/support/env.rb
@@ -14,7 +14,7 @@ def run_command(cmd, timeout = nil)
14
end
15
16
def unset_bundler_env_vars
17
- empty_env = with_environment { with_unbundled_env { ENV.to_h } }
+ 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
@@ -31,6 +31,14 @@ def with_unbundled_env
31
Bundler.with_clean_env { yield }
32
33
34
+
35
+ def env_to_h
36
+ if RUBY_VERSION > '2.0'
37
+ ENV.to_h
38
+ else
39
+ ENV.inject({}) { |h, (k, v)| h[k] = v; h }
40
+ end
41
42
43
44
World(ArubaExt)
0 commit comments