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
|
||||
alias Jol.Blog.Parser
|
||||
|
||||
test "parses attrs from zola-style posts" do
|
||||
setup do
|
||||
content = """
|
||||
+++
|
||||
title = "test post"
|
||||
|
@ -16,7 +16,11 @@ defmodule Jol.Blog.ParserTest do
|
|||
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!"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue