Refactor test to use setup()
This commit is contained in:
parent
e09c58befd
commit
120bb8e5fb
|
@ -2,7 +2,7 @@ defmodule Jol.Blog.ParserTest do
|
||||||
use ExUnit.Case, async: true
|
use ExUnit.Case, async: true
|
||||||
alias Jol.Blog.Parser
|
alias Jol.Blog.Parser
|
||||||
|
|
||||||
test "parses attrs from zola-style posts" do
|
setup do
|
||||||
content = """
|
content = """
|
||||||
+++
|
+++
|
||||||
title = "test post"
|
title = "test post"
|
||||||
|
@ -16,7 +16,11 @@ defmodule Jol.Blog.ParserTest do
|
||||||
Body!
|
Body!
|
||||||
"""
|
"""
|
||||||
|
|
||||||
{_attrs, body} = Parser.parse("/fake/filename", content)
|
{:ok, content: content}
|
||||||
|
end
|
||||||
|
|
||||||
|
test "parses attrs from zola-style posts", post do
|
||||||
|
{_attrs, body} = Parser.parse("/fake/filename", post.content)
|
||||||
assert body == "Body!"
|
assert body == "Body!"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue