tests: expand help and help-related tests

Closes #114.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
This commit is contained in:
Martin Afanasjew 2016-04-19 08:50:03 +02:00
parent d9363a1559
commit b53f0c5ada

View File

@ -130,8 +130,21 @@ class IntegrationCommandTests < Homebrew::TestCase
end end
def test_help def test_help
assert_match "Example usage:", assert_match "Example usage:\n",
cmd("help") 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 end
def test_config def test_config