2019-09-19 18:06:13 +00:00
|
|
|
const TEMPLATES_DIR = contractuser(PT.TEMPLATES_DIR)
|
|
|
|
const LICENSES_DIR = joinpath(TEMPLATES_DIR, "licenses")
|
2019-09-02 14:20:33 +00:00
|
|
|
|
|
|
|
@testset "Show methods" begin
|
|
|
|
@testset "Plugins" begin
|
|
|
|
expected = """
|
|
|
|
Readme:
|
2019-09-19 18:06:13 +00:00
|
|
|
file: "$(joinpath(TEMPLATES_DIR, "README.md"))"
|
2019-09-02 14:20:33 +00:00
|
|
|
destination: "README.md"
|
|
|
|
inline_badges: false
|
|
|
|
"""
|
2019-09-03 11:15:53 +00:00
|
|
|
@test sprint(show, MIME("text/plain"), Readme()) == rstrip(expected)
|
2019-09-02 14:20:33 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
@testset "Template" begin
|
|
|
|
expected = """
|
|
|
|
Template:
|
|
|
|
authors: ["$USER"]
|
2019-09-03 11:15:53 +00:00
|
|
|
dir: "$(contractuser(Pkg.devdir()))"
|
2019-09-02 14:20:33 +00:00
|
|
|
host: "github.com"
|
2019-09-25 13:48:39 +00:00
|
|
|
julia: v"1.0.0"
|
2019-09-02 14:20:33 +00:00
|
|
|
user: "$USER"
|
|
|
|
plugins:
|
2019-12-17 06:21:03 +00:00
|
|
|
CompatHelper:
|
|
|
|
file: "$(joinpath(TEMPLATES_DIR, "github", "workflows", "CompatHelper.yml"))"
|
|
|
|
destination: "CompatHelper.yml"
|
2020-02-15 13:45:08 +00:00
|
|
|
cron: "0 0 * * *"
|
2019-09-19 18:06:13 +00:00
|
|
|
Git:
|
|
|
|
ignore: String[]
|
|
|
|
ssh: false
|
|
|
|
manifest: false
|
|
|
|
gpgsign: false
|
2019-09-02 14:20:33 +00:00
|
|
|
License:
|
2019-09-19 18:06:13 +00:00
|
|
|
path: "$(joinpath(LICENSES_DIR, "MIT"))"
|
2019-09-02 14:20:33 +00:00
|
|
|
destination: "LICENSE"
|
2019-11-04 08:58:32 +00:00
|
|
|
ProjectFile:
|
|
|
|
version: v"0.1.0"
|
2019-09-03 11:15:53 +00:00
|
|
|
Readme:
|
2019-09-19 18:06:13 +00:00
|
|
|
file: "$(joinpath(TEMPLATES_DIR, "README.md"))"
|
2019-09-03 11:15:53 +00:00
|
|
|
destination: "README.md"
|
|
|
|
inline_badges: false
|
2019-09-19 18:06:13 +00:00
|
|
|
SrcDir:
|
|
|
|
file: "$(joinpath(TEMPLATES_DIR, "src", "module.jl"))"
|
2019-11-02 13:16:47 +00:00
|
|
|
TagBot:
|
2020-02-14 17:22:28 +00:00
|
|
|
file: "$(joinpath(TEMPLATES_DIR, "github", "workflows", "TagBot.yml"))"
|
2019-11-02 13:16:47 +00:00
|
|
|
destination: "TagBot.yml"
|
2020-04-17 20:45:06 +00:00
|
|
|
cron: "0 0 * * *"
|
2020-02-15 07:26:25 +00:00
|
|
|
token: Secret("GITHUB_TOKEN")
|
2020-02-14 17:22:28 +00:00
|
|
|
ssh: nothing
|
|
|
|
ssh_password: nothing
|
|
|
|
changelog: nothing
|
|
|
|
changelog_ignore: nothing
|
|
|
|
gpg: nothing
|
|
|
|
gpg_password: nothing
|
2019-11-12 11:17:58 +00:00
|
|
|
registry: nothing
|
2020-02-14 17:22:28 +00:00
|
|
|
branches: nothing
|
|
|
|
dispatch: nothing
|
|
|
|
dispatch_delay: nothing
|
2019-09-03 11:15:53 +00:00
|
|
|
Tests:
|
2019-09-19 18:06:13 +00:00
|
|
|
file: "$(joinpath(TEMPLATES_DIR, "test", "runtests.jl"))"
|
2019-09-18 14:25:48 +00:00
|
|
|
project: false
|
2019-09-02 14:20:33 +00:00
|
|
|
"""
|
2019-09-03 11:15:53 +00:00
|
|
|
@test sprint(show, MIME("text/plain"), tpl(; authors=USER)) == rstrip(expected)
|
|
|
|
end
|
|
|
|
|
|
|
|
@testset "show as serialization" begin
|
|
|
|
t1 = tpl()
|
|
|
|
t2 = eval(Meta.parse(sprint(show, t1)))
|
2020-02-15 07:26:25 +00:00
|
|
|
@test t1 == t2
|
2019-09-02 14:20:33 +00:00
|
|
|
end
|
|
|
|
end
|