Skip to content

Commit

Permalink
Merge pull request #50 from davidanthoff/test-save-load-spec
Browse files Browse the repository at this point in the history
Add tests for savespec and loadspec
  • Loading branch information
davidanthoff committed Feb 1, 2018
2 parents 2a04981 + dfe98d7 commit 48f5538
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion test/test_io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ p = VegaLite.data(DataFrame(x = [1,2,3], y=[1,2,3])) |>
markpoint() |>
encoding(xquantitative(field=:x), yquantitative(field=:y))

Compat.Filesystem.mktempdir() do folder
Base.Filesystem.mktempdir() do folder
svg(joinpath(folder,"test1.svg"), p)
@test isfile(joinpath(folder,"test1.svg"))

Expand All @@ -32,4 +32,17 @@ Compat.Filesystem.mktempdir() do folder
savefig(joinpath(folder,"test2.eps"), p)
@test isfile(joinpath(folder,"test2.eps"))

VegaLite.savespec(joinpath(folder,"test1.vegalite"), p)
@test isfile(joinpath(folder,"test1.vegalite"))

# TODO Enable once FileIO registration is merged
# save(p, joinpath(folder,"test2.vegalite"))
# @test isfile(joinpath(folder,"test2.vegalite"))

p2 = VegaLite.loadspec(joinpath(folder,"test1.vegalite"))
@test isa(p2, VegaLite.VLSpec)

# TODO Enable once FileIO registration is merged
# p2 = load(joinpath(folder,"test1.vegalite"))
# @test isa(p2, VLSpec)
end

0 comments on commit 48f5538

Please sign in to comment.