aprs.me/test/aprsme/is/is_supervisor_test.exs
Graham McIntire b86153cd27
Fix all mix credo --strict warnings (188 → 0)
- Replace apply/2 with direct fully-qualified calls in movement_test
- Fix assert_receive timeouts < 1000ms across 8 test files
- Move nested import statements to module-level scope
- Fix tests with no assertions and add missing doctest
- Replace weak type assertions with specific value checks
- Fix conditional assertions and length/1 expensive patterns
- Disable inappropriate Jump.CredoChecks.AvoidSocketAssignsInTest
- Fix tests not calling application code with credo:disable
- Add various credo:disable comments for legitimate patterns
2026-06-12 16:27:20 -05:00

26 lines
1 KiB
Elixir

defmodule Aprsme.Is.IsSupervisorTest do
use ExUnit.Case, async: false
alias Aprsme.Is.IsSupervisor
describe "init/1" do
test "returns a supervisor spec with Aprsme.Is as a child" do
# init/1 returns the {:ok, sup_flags, child_specs} tuple wrapped via
# Supervisor.init/2 — the safest assertion is that the return type is
# a valid supervisor init result.
assert {:ok, {_sup_flags, child_specs}} = IsSupervisor.init(:ok)
assert match?([_ | _], child_specs)
assert Enum.any?(child_specs, fn spec -> spec.id == Aprsme.Is end)
end
end
describe "start_link/1" do
test "the supervisor module exists and is callable" do
# We can't actually start the supervisor because Aprsme.Is.init/1 stops
# itself in the test environment via :test_environment_disabled.
# Verify init/1 returns the expected supervisor spec.
assert {:ok, {_sup_flags, child_specs}} = IsSupervisor.init(:ok)
assert Enum.any?(child_specs, fn spec -> spec.id == Aprsme.Is end)
end
end
end