Cyclium.Test.ActorCase (Cyclium v0.2.0)

Copy Markdown View Source

Test helpers for validating actor module definitions.

Smoke-tests that an actor compiles correctly, has valid expectations, strategies resolve, and configuration is well-formed.

Usage

defmodule MyApp.Actors.ProjectHealthActorTest do
  use ExUnit.Case, async: true
  use Cyclium.Test.ActorCase

  test "actor definition is valid" do
    assert_valid_actor(MyApp.Actors.ProjectHealthActor)
  end

  test "all expectations have strategies" do
    assert_strategies_defined(MyApp.Actors.ProjectHealthActor)
  end
end

Summary

Functions

Assert that every expectation has valid budget configuration.

Assert that the actor's spec_rev is set. Useful for enforcing version tracking across all actors in a project.

Assert that every expectation on the actor has a strategy declared.

Assert that an actor module has a valid definition: config, identifier, and at least one expectation.

Functions

assert_budgets_valid(actor_module)

(macro)

Assert that every expectation has valid budget configuration.

assert_spec_rev_set(actor_module)

(macro)

Assert that the actor's spec_rev is set. Useful for enforcing version tracking across all actors in a project.

assert_strategies_defined(actor_module)

(macro)

Assert that every expectation on the actor has a strategy declared.

assert_valid_actor(actor_module)

(macro)

Assert that an actor module has a valid definition: config, identifier, and at least one expectation.