aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
diff options
context:
space:
mode:
authorKaito Udagawa2016-11-18 20:47:46 +0900
committerKaito Udagawa2016-11-18 20:47:46 +0900
commite9815bf2bd2950b5450f0c3ed3bb7eadd3b4cbb3 (patch)
tree47902cfd8529b1825bd21af3742ad21cdfeb5fb3 /Library/Homebrew/test
parentd9ee2d75c570f6c9cfb79157269c9eea86a9d5b4 (diff)
downloadbrew-e9815bf2bd2950b5450f0c3ed3bb7eadd3b4cbb3.tar.bz2
install: add tests with custom requirements
Diffstat (limited to 'Library/Homebrew/test')
-rw-r--r--Library/Homebrew/test/install_test.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/Library/Homebrew/test/install_test.rb b/Library/Homebrew/test/install_test.rb
index fa1057a02..9fe5fff0e 100644
--- a/Library/Homebrew/test/install_test.rb
+++ b/Library/Homebrew/test/install_test.rb
@@ -27,4 +27,27 @@ class IntegrationCommandTestInstall < IntegrationCommandTestCase
assert_match "testball1: this formula has no --with-fo option so it will be ignored!",
cmd("install", "testball1", "--with-fo")
end
+
+ def test_install_with_nonfatal_requirement
+ setup_test_formula "testball1", <<-EOS.undent
+ class NonFatalRequirement < Requirement
+ satisfy { false }
+ end
+ depends_on NonFatalRequirement
+ EOS
+ message = "NonFatalRequirement unsatisfied!"
+ assert_equal 1, cmd("install", "testball1").scan(message).size
+ end
+
+ def test_install_with_fatal_requirement
+ setup_test_formula "testball1", <<-EOS.undent
+ class FatalRequirement < Requirement
+ fatal true
+ satisfy { false }
+ end
+ depends_on FatalRequirement
+ EOS
+ message = "FatalRequirement unsatisfied!"
+ assert_equal 1, cmd_fail("install", "testball1").scan(message).size
+ end
end