aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMartin Afanasjew2016-04-19 08:50:03 +0200
committerMartin Afanasjew2016-04-20 13:46:10 +0200
commitb53f0c5ada753d5ded6f6fbe4f920a4a43696394 (patch)
treeb525aacef838865beec4c4f03004abba1a16ca2f /Library
parentd9363a15590ddb8aad3e8e5444a972eaa79fd05e (diff)
downloadbrew-b53f0c5ada753d5ded6f6fbe4f920a4a43696394.tar.bz2
tests: expand help and help-related tests
Closes #114. Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/test/test_integration_cmds.rb17
1 files changed, 15 insertions, 2 deletions
diff --git a/Library/Homebrew/test/test_integration_cmds.rb b/Library/Homebrew/test/test_integration_cmds.rb
index 38cfe5e24..63076a4df 100644
--- a/Library/Homebrew/test/test_integration_cmds.rb
+++ b/Library/Homebrew/test/test_integration_cmds.rb
@@ -130,8 +130,21 @@ class IntegrationCommandTests < Homebrew::TestCase
end
def test_help
- assert_match "Example usage:",
- cmd("help")
+ assert_match "Example usage:\n",
+ cmd_fail # Generic help (empty argument list).
+ assert_match "Unknown command: command-that-does-not-exist",
+ cmd_fail("help", "command-that-does-not-exist")
+ assert_match(/^brew cat /,
+ cmd_fail("cat")) # Missing formula argument triggers help.
+
+ assert_match "Example usage:\n",
+ cmd("help") # Generic help.
+ assert_match(/^brew cat /,
+ cmd("help", "cat")) # Internal command (documented, Ruby).
+ assert_match(/^brew update /,
+ cmd("help", "update")) # Internal command (documented, Shell).
+ assert_match "Example usage:\n",
+ cmd("help", "test-bot") # Internal command (undocumented).
end
def test_config