Fix interactive code for one-field types (#176)

This commit is contained in:
Chris de Graaf 2020-05-27 15:06:08 -05:00 committed by GitHub
parent ab075ca47d
commit 9021985de9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -17,7 +17,7 @@ Interactively create a plugin of type `T`. Implement this method and ignore othe
related functions only if you want completely custom behaviour.
"""
function interactive(T::Type)
pairs = interactive_pairs(T)
pairs = Vector{Pair{Symbol, Type}}(interactive_pairs(T))
# There must be at least 2 MultiSelectMenu options.
# If there are none, return immediately.

View File

@ -198,6 +198,14 @@ end
@test PT.interactive(TagBot) == TagBot(; changelog=nothing)
end
@testset "Only one field" begin
print(
stdin.buffer,
DOWN, CR, DONE, # Select "None" option
)
@test PT.interactive(Codecov) == Codecov()
end
println()
end
end