aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
diff options
context:
space:
mode:
authorShaun Jackman2017-12-01 15:00:27 -0800
committerShaun Jackman2017-12-02 15:52:01 -0800
commit7adee6d62fabae0244d611069f09ab906a459805 (patch)
treed9315fecb1abf11b9af470cfd31bff8b5a28a211 /Library/Homebrew/test
parentdfe0a1eb898dcee72dc113737c79bff588383130 (diff)
downloadbrew-7adee6d62fabae0244d611069f09ab906a459805.tar.bz2
Utils.popen_read: Nonexistent program should fail
Ensure that $CHILD_STATUS.success? is false when the command does not exist.
Diffstat (limited to 'Library/Homebrew/test')
-rw-r--r--Library/Homebrew/test/utils/popen_spec.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/Library/Homebrew/test/utils/popen_spec.rb b/Library/Homebrew/test/utils/popen_spec.rb
index 63bbc7b18..d1ae12d1c 100644
--- a/Library/Homebrew/test/utils/popen_spec.rb
+++ b/Library/Homebrew/test/utils/popen_spec.rb
@@ -15,6 +15,12 @@ describe Utils do
).to eq("success")
expect($CHILD_STATUS).to be_a_success
end
+
+ it "fails when the command does not exist" do
+ expect(subject.popen_read("./nonexistent", err: :out))
+ .to eq("brew: command not found: ./nonexistent\n")
+ expect($CHILD_STATUS).to be_a_failure
+ end
end
describe "::popen_write" do