chronoscope/test/support/mocks.ex

20 lines
730 B
Elixir

defmodule Chronoscope.DateTime.Behaviour do
@callback utc_now :: DateTime.t()
end
defmodule Chronoscope.DateTime.Stub do
@behaviour Chronoscope.DateTime.Behaviour
def utc_now(), do: DateTime.utc_now()
end
defmodule Chronoscope.SSL.Behaviour do
@callback connect(any(), any(), any(), any()) :: {:ok, any()} | {:error, any()}
@callback send(any(), any()) :: :ok | {:error, any()}
@callback peercert(any()) :: {:ok, any()} | {:error, any()}
@callback close(any()) :: :ok | {:error, any()}
end
Mox.defmock(Chronoscope.NTS.BehaviourMock, for: Chronoscope.NTS.Behaviour)
Mox.defmock(Chronoscope.NTS.DateTimeMock, for: Chronoscope.DateTime.Behaviour)
Mox.defmock(Chronoscope.NTS.SSLMock, for: Chronoscope.SSL.Behaviour)