chronoscope/test/support/mocks.ex

20 lines
730 B
Elixir
Raw Normal View History

2024-04-01 10:40:35 -04:00
defmodule Chronoscope.DateTime.Behaviour do
2024-03-31 11:57:21 -04:00
@callback utc_now :: DateTime.t()
end
2024-04-01 10:40:35 -04:00
defmodule Chronoscope.DateTime.Stub do
@behaviour Chronoscope.DateTime.Behaviour
def utc_now(), do: DateTime.utc_now()
end
2024-04-13 11:42:15 -04:00
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
2024-03-30 11:32:28 -04:00
Mox.defmock(Chronoscope.NTS.BehaviourMock, for: Chronoscope.NTS.Behaviour)
2024-04-01 10:40:35 -04:00
Mox.defmock(Chronoscope.NTS.DateTimeMock, for: Chronoscope.DateTime.Behaviour)
2024-04-13 11:42:15 -04:00
Mox.defmock(Chronoscope.NTS.SSLMock, for: Chronoscope.SSL.Behaviour)