chronoscope/test/support/case.ex

27 lines
517 B
Elixir

defmodule Chronoscope.Case do
use ExUnit.CaseTemplate
using do
quote do
import Chronoscope.Case
end
end
setup _tags do
Mox.stub_with(Chronoscope.NTS.DateTimeMock, Chronoscope.DateTime.Stub)
:ok
end
def peercert() do
:secp256r1
|> X509.PrivateKey.new_ec()
|> X509.Certificate.self_signed("/C=US/ST=CA/L=San Francisco/O=Acme/CN=Test")
|> X509.Certificate.to_der()
end
def send_ssl_response(response) do
send(self(), {:ssl, nil, response})
:ok
end
end