An Elixir feed parser. Supports RSS2, Atom, JSON Feed, and RSS-in-JSON.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
771 B

defmodule FeedParserTest do
use ExUnit.Case
doctest FeedParser
test "parses atom feed" do
data = File.read!("test/fixtures/atom/feed.xml")
assert {:ok, %FeedParser.Feed{}} = FeedParser.parse(data, "application/xml")
end
test "parses rss2 feed" do
data = File.read!("test/fixtures/rss2/feed.xml")
assert {:ok, %FeedParser.Feed{}} = FeedParser.parse(data, "application/xml")
end
test "parses json feed" do
data = File.read!("test/fixtures/jsonfeed/feed.json")
assert {:ok, %FeedParser.Feed{}} = FeedParser.parse(data, "application/json")
end
test "parses rss-in-json feed" do
data = File.read!("test/fixtures/rssinjson/feed.json")
assert {:ok, %FeedParser.Feed{}} = FeedParser.parse(data, "application/json")
end
end