Add more git tests

This commit is contained in:
Chris de Graaf 2018-11-09 14:51:51 -06:00
parent 3ecb8442ff
commit b82050cd0f
2 changed files with 21 additions and 8 deletions

View File

@ -43,6 +43,13 @@
@test !t.manifest @test !t.manifest
@test isempty(t.plugins) @test isempty(t.plugins)
println() println()
# Host and SSH aren't prompted for when git is disabled.
write(stdin.buffer, "$me\n\n\r\n\nd")
t = interactive_template(; git=false)
@test t.host == "github.com"
@test !t.ssh
println()
end end
@testset "Package generation" begin @testset "Package generation" begin

View File

@ -27,14 +27,14 @@ const test_file = tempname()
const default_dir = Pkg.devdir() const default_dir = Pkg.devdir()
const gitconfig = GitConfig(joinpath(@__DIR__, "gitconfig")) const gitconfig = GitConfig(joinpath(@__DIR__, "gitconfig"))
const template_text = """ const template_text = """
PKGNAME: {{PKGNAME}} PKGNAME: {{PKGNAME}}
VERSION: {{VERSION}}} VERSION: {{VERSION}}}
{{#DOCUMENTER}}Documenter{{/DOCUMENTER}} {{#DOCUMENTER}}Documenter{{/DOCUMENTER}}
{{#CODECOV}}Codecov{{/CODECOV}} {{#CODECOV}}Codecov{{/CODECOV}}
{{#COVERALLS}}Coveralls{{/COVERALLS}} {{#COVERALLS}}Coveralls{{/COVERALLS}}
{{#AFTER}}After{{/AFTER}} {{#AFTER}}After{{/AFTER}}
{{#OTHER}}Other{{/OTHER}} {{#OTHER}}Other{{/OTHER}}
""" """
write(test_file, template_text) write(test_file, template_text)
@testset "Template creation" begin @testset "Template creation" begin
@ -331,6 +331,12 @@ end
rm(temp_dir; recursive=true) rm(temp_dir; recursive=true)
end end
@testset "Git-less template creation" begin
if isempty(LibGit2.getconfig("user.name", ""))
@test_nowarn Template(; user=me, git=false)
end
end
@testset "Git-less package generation" begin @testset "Git-less package generation" begin
t = Template(; user=me) t = Template(; user=me)
generate(test_pkg, t; git=false) generate(test_pkg, t; git=false)