feat(agent): expose compile-time version

This commit is contained in:
Carsten 2026-04-21 22:06:25 +02:00
parent 70923eebfa
commit 7ec38e0fd6
2 changed files with 8 additions and 18 deletions

View file

@ -1,18 +1,8 @@
defmodule ProxmoxAgent do
@moduledoc """
Documentation for `ProxmoxAgent`.
"""
@moduledoc "Top-level namespace. Exposes the compiled version for reporting."
@doc """
Hello world.
@version Mix.Project.config()[:version]
## Examples
iex> ProxmoxAgent.hello()
:world
"""
def hello do
:world
end
@spec version() :: String.t()
def version, do: @version
end

View file

@ -1,8 +1,8 @@
defmodule ProxmoxAgentTest do
use ExUnit.Case
doctest ProxmoxAgent
use ExUnit.Case, async: true
test "greets the world" do
assert ProxmoxAgent.hello() == :world
test "version/0 returns a non-empty string" do
assert is_binary(ProxmoxAgent.version())
assert ProxmoxAgent.version() != ""
end
end