aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/test_integration_cmds_help.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/test/test_integration_cmds_help.rb')
-rw-r--r--Library/Homebrew/test/test_integration_cmds_help.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_integration_cmds_help.rb b/Library/Homebrew/test/test_integration_cmds_help.rb
new file mode 100644
index 000000000..44fd774c9
--- /dev/null
+++ b/Library/Homebrew/test/test_integration_cmds_help.rb
@@ -0,0 +1,21 @@
+require "integration_cmds_tests"
+
+class IntegrationCommandTestHelp < IntegrationCommandTests
+ def test_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(/^brew update-test /,
+ cmd("help", "update-test")) # Internal developer command (documented, Ruby).
+ end
+end