add tests

This commit is contained in:
mmacia committed 2026-03-04 20:07:01 +00:00
1 parent 44f2bd73f8
commit d614a140c3
4 files changed
+74

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
defmodule FeedReader.TestSupport.ExternalFormat do
@moduledoc false
@behaviour FeedReader.Format
alias FeedReader.{Feed, Item}
@impl true
def id, do: :external_test
@impl true
def matches_prefix?("<external-feed" <> _rest), do: true
def matches_prefix?(_prefix), do: false
@impl true
def handler, do: FeedReader.TestSupport.ExternalFormatHandler
@impl true
def new_parser_state(event_sink, opts), do: %{event_sink: event_sink, opts: opts}
@impl true
def normalize_feed(_state, _opts), do: %Feed{title: "External", type: :rss}
@impl true
def normalize_item(%{title: title}, _feed, _opts), do: {:ok, %Item{title: title}}
end