aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/ENV_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/test/ENV_spec.rb')
-rw-r--r--Library/Homebrew/test/ENV_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/Library/Homebrew/test/ENV_spec.rb b/Library/Homebrew/test/ENV_spec.rb
index 07f6cdb6b..8b39e52d7 100644
--- a/Library/Homebrew/test/ENV_spec.rb
+++ b/Library/Homebrew/test/ENV_spec.rb
@@ -141,6 +141,20 @@ shared_examples EnvActivation do
expect(subject["MAKEFLAGS"]).to eq("-j4")
end
+
+ describe "#clear_sensitive_environment!" do
+ it "removes sensitive environment variables" do
+ subject["SECRET_TOKEN"] = "password"
+ subject.clear_sensitive_environment!
+ expect(subject).not_to include("SECRET_TOKEN")
+ end
+
+ it "leaves non-sensitive environment variables alone" do
+ subject["FOO"] = "bar"
+ subject.clear_sensitive_environment!
+ expect(subject["FOO"]).to eq "bar"
+ end
+ end
end
describe Stdenv do