aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/test')
-rw-r--r--Library/Homebrew/test/ENV_spec.rb14
-rw-r--r--Library/Homebrew/test/dev-cmd/ruby_spec.rb13
2 files changed, 27 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
diff --git a/Library/Homebrew/test/dev-cmd/ruby_spec.rb b/Library/Homebrew/test/dev-cmd/ruby_spec.rb
new file mode 100644
index 000000000..e05bccc83
--- /dev/null
+++ b/Library/Homebrew/test/dev-cmd/ruby_spec.rb
@@ -0,0 +1,13 @@
+describe "brew ruby", :integration_test do
+ it "executes ruby code with Homebrew's libraries loaded" do
+ expect { brew "ruby", "-e", "exit 0" }
+ .to be_a_success
+ .and not_to_output.to_stdout
+ .and not_to_output.to_stderr
+
+ expect { brew "ruby", "-e", "exit 1" }
+ .to be_a_failure
+ .and not_to_output.to_stdout
+ .and not_to_output.to_stderr
+ end
+end