From ab261170efe6b82943674f82139ecd1aff4e13c0 Mon Sep 17 00:00:00 2001 From: Chris de Graaf Date: Wed, 19 Sep 2018 14:57:21 -0500 Subject: [PATCH] A few more deprecations still --- src/plugin.jl | 2 +- src/plugins/documenter.jl | 3 +-- test/plugins/githubpages.jl | 4 ++-- test/tests.jl | 15 +++++++++------ 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/plugin.jl b/src/plugin.jl index ab5bfae..837d21e 100644 --- a/src/plugin.jl +++ b/src/plugin.jl @@ -268,7 +268,7 @@ function interactive( if default_config_file == nothing print("[None]: ") else - print("[$(replace(default_config_file, homedir(), "~"))]: ") + print("[$(replace(default_config_file, homedir() => "~"))]: ") end config_file = readline() config_file = if uppercase(config_file) == "NONE" diff --git a/src/plugins/documenter.jl b/src/plugins/documenter.jl index 3f91027..e0fda5f 100644 --- a/src/plugins/documenter.jl +++ b/src/plugins/documenter.jl @@ -31,7 +31,6 @@ function gen_plugin( assets_string *= """$(tab^2)"assets/$(basename(asset))",\n""" end assets_string *= "$tab]" - else assets_string = "[]" end @@ -71,7 +70,7 @@ function show(io::IO, p::Documenter) if n == 0 println(io) else - println(io, ": $(join(map(a -> replace(a, homedir(), "~"), p.assets), ", "))") + println(io, ": $(join(map(a -> replace(a, homedir() => "~"), p.assets), ", "))") end n = length(p.gitignore) diff --git a/test/plugins/githubpages.jl b/test/plugins/githubpages.jl index aff7fb7..f509b9f 100644 --- a/test/plugins/githubpages.jl +++ b/test/plugins/githubpages.jl @@ -37,13 +37,13 @@ pkg_dir = joinpath(temp_dir, test_pkg) p = GitHubPages(; assets=[test_file]) @test gen_plugin(p, t, temp_dir, test_pkg) == ["docs/"] make = readchomp(joinpath(pkg_dir, "docs", "make.jl")) - @test contains( - make, + @test occursin( strip(""" assets=[ "assets/$(basename(test_file))", ] """), + make, ) @test isfile(joinpath(pkg_dir, "docs", "src", "assets", basename(test_file))) rm(joinpath(pkg_dir, "docs"); recursive=true) diff --git a/test/tests.jl b/test/tests.jl index fdf5c7f..07f6029 100644 --- a/test/tests.jl +++ b/test/tests.jl @@ -214,17 +214,20 @@ end @test occursin(join(badges(p, t.user, test_pkg), "\n"), readme) end # Check the order of the badges. - @test search(readme, "github.io").start < - search(readme, "travis").start < - search(readme, "appveyor").start < - search(readme, "codecov").start < - search(readme, "coveralls").start + @test something(findfirst("github.io", readme)).start < + something(findfirst("travis", readme)).start < + something(findfirst("appveyor", readme)).start < + something(findfirst("codecov", readme)).start < + something(findfirst("coveralls", readme)).start # Plugins with badges but not in BADGE_ORDER should appear at the far right side. t.plugins[Foo] = Foo() gen_readme(temp_dir, test_pkg, t) readme = readchomp(joinpath(pkg_dir, "README.md")) rm(joinpath(pkg_dir, "README.md")) - @test search(readme, "coveralls").start < search(readme, "baz").start + @test <( + something(findfirst("coveralls", readme)).start, + something(findfirst("baz", readme)).start, + ) @test gen_gitignore(temp_dir, test_pkg, t) == [".gitignore"] @test isfile(joinpath(pkg_dir, ".gitignore"))