Info item arg processing test: handle multi-line return values

This commit is contained in:
Michael Klishin 2019-03-18 07:47:03 +03:00
parent f73bca4c1d
commit f6bb9487ef
1 changed files with 5 additions and 2 deletions

View File

@ -65,8 +65,11 @@ defmodule ArgsProcessingTest do
commands = list_commands()
Enum.each(commands, fn(command) ->
items_usage = case command.usage_additional() do
list when is_list(list) -> Enum.join(list, "\n")
string -> string
# find the line with info items, ignore the rest
list when is_list(list) ->
Enum.filter(list, fn line -> Regex.match?(~r/must be one of/, line) end) |> List.first
string ->
string
end
# info_item, info_item2, …
case Regex.run(~r/.*one of (.*)$/, items_usage, [capture: :all_but_first]) do