gemini-ex/test/gemini/response_test.exs

15 lines
439 B
Elixir

defmodule Gemini.ResponseTest do
use ExUnit.Case
alias Gemini.Response
doctest Response
test "parses a response with a body" do
assert Response.parse("20 text/gemini\r\nsome body") ==
{:ok, %Response{status: 20, meta: "text/gemini", body: "some body"}}
end
test "parses a response without a body" do
assert Response.parse("31 /foo\r\n") == {:ok, %Response{status: 31, meta: "/foo", body: nil}}
end
end