31 lines
944 B
Elixir
31 lines
944 B
Elixir
defmodule Frenzy.OPML.ImporterTests do
|
|
use ExUnit.Case
|
|
alias Frenzy.OPML.Importer
|
|
doctest Importer
|
|
|
|
@opml """
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!-- OPML generated by NetNewsWire -->
|
|
<opml version="1.1">
|
|
<head>
|
|
<title>Subscriptions-OnMyMac.opml</title>
|
|
</head>
|
|
<body>
|
|
<outline text="Julia Evans" title="Julia Evans" description="" type="rss" version="RSS" htmlUrl="" xmlUrl="https://jvns.ca/atom.xml"/>
|
|
<outline text="my folder" title="my folder">
|
|
<outline text="The Shape of Everything" title="The Shape of Everything" description="" type="rss" version="RSS" htmlUrl="https://shapeof.com/" xmlUrl="https://shapeof.com/feed.json"/>
|
|
</outline>
|
|
</body>
|
|
</opml>
|
|
"""
|
|
|
|
test "parse simple OPML" do
|
|
res = Importer.parse_opml(@opml)
|
|
|
|
assert res == %{
|
|
:default => ["https://jvns.ca/atom.xml"],
|
|
"my folder" => ["https://shapeof.com/feed.json"]
|
|
}
|
|
end
|
|
end
|