2019-09-02 14:20:33 +00:00
|
|
|
const DEFAULTS_DIR = contractuser(PT.DEFAULTS_DIR)
|
2019-09-19 05:51:04 +00:00
|
|
|
const LICENSE_DIR = contractuser(joinpath(PT.DEFAULTS_DIR, "licenses"))
|
2019-09-02 14:20:33 +00:00
|
|
|
|
|
|
|
@testset "Show methods" begin
|
|
|
|
@testset "Plugins" begin
|
|
|
|
expected = """
|
|
|
|
Readme:
|
2019-09-19 00:58:48 +00:00
|
|
|
file: "$(joinpath(DEFAULTS_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"]
|
|
|
|
develop: true
|
2019-09-03 11:15:53 +00:00
|
|
|
dir: "$(contractuser(Pkg.devdir()))"
|
2019-09-02 14:20:33 +00:00
|
|
|
git: true
|
|
|
|
host: "github.com"
|
|
|
|
julia_version: v"1.0.0"
|
|
|
|
manifest: false
|
|
|
|
ssh: false
|
|
|
|
user: "$USER"
|
|
|
|
plugins:
|
|
|
|
Gitignore:
|
|
|
|
ds_store: true
|
|
|
|
dev: true
|
|
|
|
License:
|
2019-09-19 00:58:48 +00:00
|
|
|
path: "$(joinpath(LICENSE_DIR, "MIT"))"
|
2019-09-02 14:20:33 +00:00
|
|
|
destination: "LICENSE"
|
2019-09-03 11:15:53 +00:00
|
|
|
Readme:
|
2019-09-19 00:58:48 +00:00
|
|
|
file: "$(joinpath(DEFAULTS_DIR, "README.md"))"
|
2019-09-03 11:15:53 +00:00
|
|
|
destination: "README.md"
|
|
|
|
inline_badges: false
|
|
|
|
Tests:
|
2019-09-19 05:51:04 +00:00
|
|
|
file: "$(joinpath(DEFAULTS_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
|
|
|
|
# Equality is not implemented for Template, so check the string form.
|
|
|
|
t1 = tpl()
|
|
|
|
t2 = eval(Meta.parse(sprint(show, t1)))
|
|
|
|
@test sprint(show, t1) == sprint(show, t2)
|
2019-09-02 14:20:33 +00:00
|
|
|
end
|
|
|
|
end
|