elixir_rss/test/feed_updater_test.exs

21 lines
538 B
Elixir
Raw Permalink Normal View History

2024-10-21 02:49:48 +00:00
defmodule FeedUpdaterTest do
use ExUnit.Case, async: true
setup do
updater = start_supervised!(ElixirRss.FeedUpdater)
%{updater: updater}
end
test "defaults to empty map", %{updater: updater} do
assert ElixirRss.FeedUpdater.get_state(updater, "some_url") == nil
end
test "successful update", %{updater: updater} do
url = "https://rss.slashdot.org/Slashdot/slashdotMain"
assert ElixirRss.FeedUpdater.update(updater, url) == :ok
assert ElixirRss.FeedUpdater.get_state(updater, url) != nil
end
end