aboutsummaryrefslogtreecommitdiff
path: root/spec/write_rockspec_spec.lua
diff options
context:
space:
mode:
authorHugo Levy-Falk <hugo@klafyvel.me>2026-07-14 00:10:33 +0200
committerHisham Muhammad <hisham@gobolinux.org>2026-07-13 19:50:25 -0300
commitddbf1ac2e38415a48c89f09238ad9b28d0c3fa68 (patch)
treeaeb7935abbb3ed8161d6128d127a50aec352bb69 /spec/write_rockspec_spec.lua
parent3e48d87a0d0527b51eb9520662b5cc2e54d5b66f (diff)
downloadluarocks-ddbf1ac2e38415a48c89f09238ad9b28d0c3fa68.tar.gz
luarocks-ddbf1ac2e38415a48c89f09238ad9b28d0c3fa68.tar.bz2
luarocks-ddbf1ac2e38415a48c89f09238ad9b28d0c3fa68.zip
fix: make write_rockspec command write valid rockspec given the rockspec_format argument.
Diffstat (limited to 'spec/write_rockspec_spec.lua')
-rw-r--r--spec/write_rockspec_spec.lua22
1 files changed, 15 insertions, 7 deletions
diff --git a/spec/write_rockspec_spec.lua b/spec/write_rockspec_spec.lua
index 2ade5986..7a8554bb 100644
--- a/spec/write_rockspec_spec.lua
+++ b/spec/write_rockspec_spec.lua
@@ -55,13 +55,21 @@ describe("luarocks ##write_rockspec tests #integration", function()
55 -- TODO check contents 55 -- TODO check contents
56 end) 56 end)
57 57
58 it("runs with format flag", function() 58 local formats = {
59 finally(function() os.remove("testrock-dev-1.rockspec") end) 59 "1.0",
60 assert.is_true(run.luarocks_bool("write_rockspec git://localhost/testrock --rockspec-format=1.1 --lua-versions=5.1,5.2")) 60 "1.1",
61 assert.is.truthy(lfs.attributes("testrock-dev-1.rockspec")) 61 "3.0",
62 assert.truthy(run.luarocks_bool("lint " .. "testrock-dev-1.rockspec")) 62 "3.1",
63 -- TODO check contents 63 }
64 end) 64 for i, format in ipairs(formats) do
65 it("runs with format flag " .. format, function()
66 finally(function() os.remove("testrock-dev-1.rockspec") end)
67 assert.is_true(run.luarocks_bool("write_rockspec git://localhost/testrock --rockspec-format=" .. format .. " --lua-versions=5.1,5.2"))
68 assert.is.truthy(lfs.attributes("testrock-dev-1.rockspec"))
69 assert.truthy(run.luarocks_bool("lint " .. "testrock-dev-1.rockspec"))
70 -- TODO check contents
71 end)
72 end
65 73
66 it("runs with full flags", function() 74 it("runs with full flags", function()
67 finally(function() os.remove("testrock-dev-1.rockspec") end) 75 finally(function() os.remove("testrock-dev-1.rockspec") end)