JOL/test/lib/blog/parser_test.exs

27 lines
475 B
Elixir
Raw Normal View History

defmodule JOL.Blog.ParserTest do
use ExUnit.Case, async: true
alias JOL.Blog.Parser
2024-05-21 16:46:48 +00:00
setup do
content = """
+++
title = "test post"
draft = false
date = 2024-01-02 14:00:00-05:00
[taxonomies]
tags = ["howto", "hardware"]
+++
Body!
"""
2024-05-21 16:46:48 +00:00
{: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