feat(agent): expose compile-time version
This commit is contained in:
parent
70923eebfa
commit
7ec38e0fd6
2 changed files with 8 additions and 18 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue