Don't add Documenter, touch up tests

This commit is contained in:
Chris de Graaf 2017-08-29 00:28:44 +01:00
parent ef7fa94a98
commit 7329fbcf90
2 changed files with 12 additions and 15 deletions

View File

@ -10,10 +10,6 @@ function gen_plugin(
dir::AbstractString, dir::AbstractString,
pkg_name::AbstractString, pkg_name::AbstractString,
) )
if Pkg.installed("Documenter") == nothing
info("Adding Documenter.jl")
Pkg.add("Documenter")
end
path = joinpath(dir, pkg_name) path = joinpath(dir, pkg_name)
docs_dir = joinpath(path, "docs", "src") docs_dir = joinpath(path, "docs", "src")
mkpath(docs_dir) mkpath(docs_dir)

View File

@ -73,7 +73,7 @@ write(test_file, template_text)
@test t.requirements == ["$test_pkg 0.1"] @test t.requirements == ["$test_pkg 0.1"]
@test_warn r".+" t = Template(; user=me, requirements=[test_pkg, test_pkg]) @test_warn r".+" t = Template(; user=me, requirements=[test_pkg, test_pkg])
@test t.requirements == [test_pkg] @test t.requirements == [test_pkg]
@test_throws ArgumentError t = Template(; @test_throws ArgumentError Template(;
user=me, user=me,
requirements=[test_pkg, "$test_pkg 0.1"] requirements=[test_pkg, "$test_pkg 0.1"]
) )
@ -105,12 +105,12 @@ write(test_file, template_text)
) )
if isempty(LibGit2.getconfig("github.user", "")) if isempty(LibGit2.getconfig("github.user", ""))
@test_throws ArgumentError t = Template() @test_throws ArgumentError Template()
else else
t = Template() t = Template()
@test t.user == LibGit2.getconfig("github.user", "") @test t.user == LibGit2.getconfig("github.user", "")
end end
@test_throws ArgumentError t = Template(; user=me, license="FakeLicense") @test_throws ArgumentError Template(; user=me, license="FakeLicense")
end end
if get(ENV, "TRAVIS_OS_NAME", "") != "osx" if get(ENV, "TRAVIS_OS_NAME", "") != "osx"
@ -134,7 +134,7 @@ end
@test isnull(p.src) @test isnull(p.src)
p = AppVeyor(; config_file=test_file) p = AppVeyor(; config_file=test_file)
@test get(p.src) == test_file @test get(p.src) == test_file
@test_throws ArgumentError p = AppVeyor(; config_file=fake_path) @test_throws ArgumentError AppVeyor(; config_file=fake_path)
p = TravisCI() p = TravisCI()
@test isempty(p.gitignore) @test isempty(p.gitignore)
@ -152,7 +152,7 @@ end
@test isnull(p.src) @test isnull(p.src)
p = TravisCI(; config_file=test_file) p = TravisCI(; config_file=test_file)
@test get(p.src) == test_file @test get(p.src) == test_file
@test_throws ArgumentError p = TravisCI(; config_file=fake_path) @test_throws ArgumentError TravisCI(; config_file=fake_path)
p = CodeCov() p = CodeCov()
@test p.gitignore == ["*.jl.cov", "*.jl.*.cov", "*.jl.mem"] @test p.gitignore == ["*.jl.cov", "*.jl.*.cov", "*.jl.mem"]
@ -170,7 +170,7 @@ end
@test isnull(p.src) @test isnull(p.src)
p = CodeCov(; config_file=test_file) p = CodeCov(; config_file=test_file)
@test get(p.src) == test_file @test get(p.src) == test_file
@test_throws ArgumentError p = CodeCov(; config_file=fake_path) @test_throws ArgumentError CodeCov(; config_file=fake_path)
p = Coveralls() p = Coveralls()
@test p.gitignore == ["*.jl.cov", "*.jl.*.cov", "*.jl.mem"] @test p.gitignore == ["*.jl.cov", "*.jl.*.cov", "*.jl.mem"]
@ -188,14 +188,14 @@ end
@test isnull(p.src) @test isnull(p.src)
p = Coveralls(; config_file=test_file) p = Coveralls(; config_file=test_file)
@test get(p.src) == test_file @test get(p.src) == test_file
@test_throws ArgumentError p = Coveralls(; config_file=fake_path) @test_throws ArgumentError Coveralls(; config_file=fake_path)
p = GitHubPages() p = GitHubPages()
@test p.gitignore == ["/docs/build/", "/docs/site/"] @test p.gitignore == ["/docs/build/", "/docs/site/"]
@test isempty(p.assets) @test isempty(p.assets)
p = GitHubPages(; assets=[test_file]) p = GitHubPages(; assets=[test_file])
@test p.assets == [test_file] @test p.assets == [test_file]
@test_throws ArgumentError p = GitHubPages(; assets=[fake_path]) @test_throws ArgumentError GitHubPages(; assets=[fake_path])
end end
@testset "Badge generation" begin @testset "Badge generation" begin
@ -309,7 +309,7 @@ end
@test contains(runtests, "using $test_pkg") @test contains(runtests, "using $test_pkg")
@test contains(runtests, "using Base.Test") @test contains(runtests, "using Base.Test")
rm(dirname(pkg_dir); recursive=true) rm(temp_dir; recursive=true)
end end
@testset "Package generation" begin @testset "Package generation" begin
@ -387,6 +387,7 @@ end
@test_warn r".+" generate(test_pkg, t) @test_warn r".+" generate(test_pkg, t)
t = Template(; user=me, dir=joinpath(temp_file, temp_file), gitconfig=gitconfig) t = Template(; user=me, dir=joinpath(temp_file, temp_file), gitconfig=gitconfig)
@test_warn r".+" generate(test_pkg, t) @test_warn r".+" generate(test_pkg, t)
rm(temp_file)
t = Template(; user=me, gitconfig=gitconfig, plugins=[GitHubPages()]) t = Template(; user=me, gitconfig=gitconfig, plugins=[GitHubPages()])
generate(test_pkg, t) generate(test_pkg, t)
@ -504,7 +505,7 @@ end
assets=[ assets=[
"assets/$(basename(test_file))", "assets/$(basename(test_file))",
] ]
""") """),
) )
@test isfile(joinpath(pkg_dir, "docs", "src", "assets", basename(test_file))) @test isfile(joinpath(pkg_dir, "docs", "src", "assets", basename(test_file)))
rm(joinpath(pkg_dir, "docs"); recursive=true) rm(joinpath(pkg_dir, "docs"); recursive=true)
@ -520,7 +521,7 @@ end
p = Baz() p = Baz()
@test isempty(gen_plugin(p, t, temp_dir, test_pkg)) @test isempty(gen_plugin(p, t, temp_dir, test_pkg))
rm(dirname(pkg_dir); recursive=true) rm(temp_dir; recursive=true)
end end
@testset "Version floor" begin @testset "Version floor" begin