Refactor and document output path (#28)

* Updated output path builder to better use yt-dlp variables

* Added UI explaining output template options

* Fixed outdated reference in dockerfile
This commit is contained in:
Kieran
2024-02-20 18:40:13 -08:00
committed by GitHub
parent af7e76c1d1
commit 1ec1a48235
12 changed files with 185 additions and 57 deletions
@@ -3,7 +3,7 @@ defmodule Pinchflat.RenderedString.ParserTest do
alias Pinchflat.RenderedString.Parser
describe "parse/2" do
describe "parse/3" do
test "it returns the rendered string when the string is valid" do
assert {:ok, "bar"} = Parser.parse("{{ foo }}", %{"foo" => "bar"})
end
@@ -36,5 +36,13 @@ defmodule Pinchflat.RenderedString.ParserTest do
test "it returns an error when the string is invalid" do
assert {:error, "expected end of string"} = Parser.parse("{{ 1-1 }", %{})
end
test "it supports a custom fetcher function" do
custom_fetcher = fn _, _ ->
"quux"
end
assert {:ok, "quux"} = Parser.parse("{{ foo }}", %{}, custom_fetcher)
end
end
end