View Source OrbitTest (Orbit v0.3.0)

Test helpers.

Summary

Functions

Returns the response body as a binary.

Returns the response meta field.

Performs a request and returns the processed request.

Returns the response status code as an atom.

Performs a full request to a Gemini server over TLS

Functions

Returns the response body as a binary.

Returns nil if the status was not a success.

Link to this function

build_client_cert(common_name, opts \\ [])

View Source

Returns a new self-signed Orbit.ClientCertificate for testing.

Options

  • :days - the number of days of validity; defaults to 1 day

Returns the response meta field.

Link to this function

request(entrypoint, path_or_url, opts \\ [])

View Source

Performs a request and returns the processed request.

If path_or_url begins with "/", a path is assumed and the requested URL becomes "gemini://localhost/<path>".

Options

  • :client_cert - the client certificate, which can be constructed with build_client_cert/2
  • :query - the URL query string, or key/value pairs as a map or keyword list

Returns the response status code as an atom.

Link to this function

tls_request(host, uri, opts \\ [])

View Source
@spec tls_request(String.t(), String.t(), Keyword.t()) :: String.t()

Performs a full request to a Gemini server over TLS

If the uri begins with "/", a path is assumed and the requested URL becomes "gemini://<host>:<port><path>".

Options

  • :port - the port to connect to; defaults to 1965
  • :ssl - the SSL options, passed on to :ssl.connect/3