From b82050cd0fd1d9c63dfc1395a37b1f85cce0c753 Mon Sep 17 00:00:00 2001 From: Chris de Graaf Date: Fri, 9 Nov 2018 14:51:51 -0600 Subject: [PATCH] Add more git tests --- test/interactive/interactive.jl | 7 +++++++ test/tests.jl | 22 ++++++++++++++-------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/test/interactive/interactive.jl b/test/interactive/interactive.jl index fea759f..ee4d491 100644 --- a/test/interactive/interactive.jl +++ b/test/interactive/interactive.jl @@ -43,6 +43,13 @@ @test !t.manifest @test isempty(t.plugins) 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 @testset "Package generation" begin diff --git a/test/tests.jl b/test/tests.jl index 34f52a4..060be6c 100644 --- a/test/tests.jl +++ b/test/tests.jl @@ -27,14 +27,14 @@ const test_file = tempname() const default_dir = Pkg.devdir() const gitconfig = GitConfig(joinpath(@__DIR__, "gitconfig")) const template_text = """ - PKGNAME: {{PKGNAME}} - VERSION: {{VERSION}}} - {{#DOCUMENTER}}Documenter{{/DOCUMENTER}} - {{#CODECOV}}Codecov{{/CODECOV}} - {{#COVERALLS}}Coveralls{{/COVERALLS}} - {{#AFTER}}After{{/AFTER}} - {{#OTHER}}Other{{/OTHER}} - """ +PKGNAME: {{PKGNAME}} +VERSION: {{VERSION}}} +{{#DOCUMENTER}}Documenter{{/DOCUMENTER}} +{{#CODECOV}}Codecov{{/CODECOV}} +{{#COVERALLS}}Coveralls{{/COVERALLS}} +{{#AFTER}}After{{/AFTER}} +{{#OTHER}}Other{{/OTHER}} +""" write(test_file, template_text) @testset "Template creation" begin @@ -331,6 +331,12 @@ end rm(temp_dir; recursive=true) 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 t = Template(; user=me) generate(test_pkg, t; git=false)