AshGrant.PolicyTest.DslGenerator (AshGrant v0.14.1)

Copy Markdown View Source

Generates Elixir DSL code from YAML policy test files.

This allows converting YAML policy tests to Elixir DSL for:

  • Importing tests from external tools
  • Converting documentation to executable tests
  • Migrating from YAML to DSL format

Examples

code = DslGenerator.generate("policy_tests/document.yaml")
File.write!("test/policy_tests/document_test.exs", code)

Summary

Functions

Generates Elixir DSL code from a YAML file.

Generates Elixir DSL code from parsed YAML data.

Functions

generate(yaml_path)

@spec generate(String.t()) :: String.t()

Generates Elixir DSL code from a YAML file.

generate_from_parsed(parsed, yaml_path \\ nil)

@spec generate_from_parsed(map(), String.t() | nil) :: String.t()

Generates Elixir DSL code from parsed YAML data.