Improve interactive gitconfig prompt and tests

This commit is contained in:
Chris de Graaf 2017-10-06 15:28:26 +01:00
parent 0292a94f9a
commit 17c05e9ed2
2 changed files with 3 additions and 3 deletions

View File

@ -215,7 +215,7 @@ function interactive_template(; fast::Bool=false)
Dict() Dict()
else else
gitconfig = Dict() gitconfig = Dict()
print("Enter any Git key-value pairs (one at a time, separated by spaces) [None]: ") print("Enter any Git key-value pairs (one per line, separated by spaces) [None]: ")
while true while true
line = readline() line = readline()
isempty(line) && break isempty(line) && break

View File

@ -25,7 +25,7 @@
@test_throws ArgumentError t = interactive_template() @test_throws ArgumentError t = interactive_template()
end end
write(STDIN.buffer, "$me\ngitlab.com\n$('\x1b')[B\r$me\n2016\n$test_file\nno\n0.5\nX Y\nA B\n\n$('\x1b')[B\r$('\x1b')[B\rd\n\n") write(STDIN.buffer, "$me\ngitlab.com\n$('\x1b')[B\r$me\n2016\n$test_file\nno\n0.5\nX Y\nkey val val\nkey2 val2\n\n$('\x1b')[B\r$('\x1b')[B\rd\n\n")
t = interactive_template() t = interactive_template()
@test t.user == me @test t.user == me
@test t.host == "gitlab.com" @test t.host == "gitlab.com"
@ -37,7 +37,7 @@
@test !t.precompile @test !t.precompile
@test t.julia_version == v"0.5.0" @test t.julia_version == v"0.5.0"
@test Set(t.requirements) == Set(["X", "Y"]) @test Set(t.requirements) == Set(["X", "Y"])
@test t.gitconfig == Dict("A" => "B") @test t.gitconfig == Dict("key" => "val val", "key2" => "val2")
# Like above, not sure which plugins this will generate. # Like above, not sure which plugins this will generate.
@test length(t.plugins) == 2 @test length(t.plugins) == 2