Skip to content

Commit

Permalink
Fix a Windows test, maybe
Browse files Browse the repository at this point in the history
  • Loading branch information
christopher-dG committed Sep 19, 2019
1 parent dc4f2be commit 445007b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 5 additions & 1 deletion src/interactive.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ function Base.show(io::IO, ::MIME"text/plain", p::T) where T <: Plugin
end

show_field(x) = repr(x)
show_field(x::AbstractString) = repr(contractuser(x))
if Sys.iswindows()
show_field(x::AbstractString) = replace(repr(contractuser(x)), "\\\\" => "\\")
else
show_field(x::AbstractString) = repr(contractuser(x))
end

function Base.show(io::IO, m::MIME"text/plain", t::Template)
println(io, "Template:")
Expand Down
2 changes: 1 addition & 1 deletion src/template.jl
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function Template(::Val{false}; kwargs...)
plugins = Dict(typeof(p) => p for p in enabled)

# TODO: It might be nice to offer some kind of warn_incompatible function
# to be optionally implented by plugins instead of hardcoding this case here.
# to be optionally implemented by plugins instead of hardcoding this case here.
julia = getkw(kwargs, :julia_version)
julia < v"1.2" && haskey(plugins, Tests) && plugins[Tests].project && @warn string(
"The Tests plugin is set to create a project (supported in Julia 1.2 and later)",
Expand Down
8 changes: 4 additions & 4 deletions test/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const LICENSE_DIR = contractuser(PT.LICENSE_DIR)
@testset "Plugins" begin
expected = """
Readme:
file: "$DEFAULTS_DIR/README.md"
file: "$(joinpath(DEFAULTS_DIR, "README.md"))"
destination: "README.md"
inline_badges: false
"""
Expand All @@ -29,14 +29,14 @@ const LICENSE_DIR = contractuser(PT.LICENSE_DIR)
ds_store: true
dev: true
License:
path: "$LICENSE_DIR/MIT"
path: "$(joinpath(LICENSE_DIR, "MIT"))"
destination: "LICENSE"
Readme:
file: "$DEFAULTS_DIR/README.md"
file: "$(joinpath(DEFAULTS_DIR, "README.md"))"
destination: "README.md"
inline_badges: false
Tests:
file: "$DEFAULTS_DIR/runtests.jl"
file: "$(joinpath(DEFAULTS_DIR, "runtests.jl"))"
project: false
"""
@test sprint(show, MIME("text/plain"), tpl(; authors=USER)) == rstrip(expected)
Expand Down

0 comments on commit 445007b

Please sign in to comment.