Refactor test to use setup()

This commit is contained in:
Jessica Canady 2024-05-21 12:46:48 -04:00
parent e09c58befd
commit 120bb8e5fb
Signed by: phoenix
SSH key fingerprint: SHA256:aaLOzOrLi+0n4eDZNQKH97PehwRt6KSE5fYJc+ZRKCQ

View file

@ -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