diff --git a/deps/rabbitmq_cli/test/list_permissions_command_test.exs b/deps/rabbitmq_cli/test/list_permissions_command_test.exs index f08e4bc9d7..8ea12518fe 100644 --- a/deps/rabbitmq_cli/test/list_permissions_command_test.exs +++ b/deps/rabbitmq_cli/test/list_permissions_command_test.exs @@ -55,10 +55,12 @@ defmodule ListPermissionsCommandTest do end @tag test_timeout: @default_timeout - test "no options lists permissions on the default", context do + test "no options lists permissions in default vhost", context do capture_io(fn -> - assert ListPermissionsCommand.run([], context[:opts]) == - [[user: "guest", configure: ".*", write: ".*", read: ".*"]] + results = ListPermissionsCommand.run([], context[:opts]) + Enum.all?([[user: "guest", configure: ".*", write: ".*", read: ".*"]], fn(perm) -> + Enum.find(results, fn(found) -> found == perm end) + end) end) end @@ -84,8 +86,10 @@ defmodule ListPermissionsCommandTest do @tag test_timeout: 30 test "sufficiently long timeouts don't interfere with results", context do capture_io(fn -> - assert ListPermissionsCommand.run([], context[:opts]) == - [[user: "guest", configure: ".*", write: ".*", read: ".*"]] + results = ListPermissionsCommand.run([], context[:opts]) + Enum.all?([[user: "guest", configure: ".*", write: ".*", read: ".*"]], fn(perm) -> + Enum.find(results, fn(found) -> found == perm end) + end) end) end