Skip to main content
Glama
cli_test.exs1.14 kB
defmodule HexdocsMcp.CLITest do use HexdocsMcp.DataCase, async: true import Mox alias HexdocsMcp.CLI alias HexdocsMcp.Embeddings.Embedding setup :verify_on_exit! setup do system_command = HexdocsMcp.Config.system_command() [system_command: system_command] end test "no arguments shows usage", %{system_command: system_command} do assert capture_io(fn -> CLI.main([]) end) =~ "Usage: #{system_command} COMMAND [options]" end test "invalid command shows usage", %{system_command: system_command} do assert capture_io(fn -> CLI.main(["invalid"]) end) =~ "Usage: #{system_command} COMMAND [options]" end test "fetch_docs initializes the database" do expect(HexdocsMcp.MockFetchDocs, :main, fn _ -> :ok end) capture_io(fn -> CLI.main(["fetch_docs", "test"]) assert Repo.all(Embedding) end) end test "semantic_search initializes the database" do expect(HexdocsMcp.MockSemanticSearch, :main, fn _ -> :ok end) capture_io(fn -> CLI.main(["semantic_search"]) assert Repo.all(Embedding) end) end end

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bradleygolden/hexdocs-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server