More end-to-end integration tests for #439

This commit is contained in:
Michael Klishin 2020-07-02 07:32:26 +03:00
parent 2101043257
commit f8c9b3db33
1 changed files with 9 additions and 0 deletions

View File

@ -224,6 +224,15 @@ defmodule RabbitMQCtlTest do
check_output(["--auto-complete", "--script-name", "rabbitmq-queues", "add_m"], "add_member\n")
end
test "autocompletion command used directly" do
# Note: these are not script name (scope) aware without --script-name
# but the actual command invoked in a shell will be
check_output(["autocomplete", "list_q"], "list_queues\n")
check_output(["autocomplete", "list_con", "--script-name", "rabbitmq-diagnostics"], "list_connections\nlist_consumers\n")
check_output(["autocomplete", "--script-name", "rabbitmq-diagnostics", "mem"], "memory_breakdown\n")
check_output(["autocomplete", "--script-name", "rabbitmq-queues", "add_m"], "add_member\n")
end
defp check_output(cmd, out) do
assert capture_io(fn ->
error_check(cmd, exit_ok())