aboutsummaryrefslogtreecommitdiffstats
path: root/tests/mason-registry/api_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tests/mason-registry/api_spec.lua')
-rw-r--r--tests/mason-registry/api_spec.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/mason-registry/api_spec.lua b/tests/mason-registry/api_spec.lua
index f7b1bf45..0027e695 100644
--- a/tests/mason-registry/api_spec.lua
+++ b/tests/mason-registry/api_spec.lua
@@ -1,4 +1,5 @@
local stub = require "luassert.stub"
+local match = require "luassert.match"
local Result = require "mason-core.result"
describe("mason-registry API", function()
@@ -38,4 +39,14 @@ describe("mason-registry API", function()
assert.same({ field = { "value" } }, result)
end)
+
+ it("should interpolate path parameters", function()
+ fetch.returns(Result.success [[{}]])
+
+ local result = api.repo.releases.latest { repo = "myrepo/name" }
+
+ assert.is_true(result:is_success())
+ assert.spy(fetch).was_called(1)
+ assert.spy(fetch).was_called_with(match.is_match "/api/repo/myrepo/name/releases/latest$", match.is_table())
+ end)
end)