JOL/test/lib/blog/parser_test.exs
2024-05-21 12:52:37 -04:00

27 lines
475 B
Elixir

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