From 539fd9f30c3ac37008de59feb05f742b8f9eaaa9 Mon Sep 17 00:00:00 2001 From: Hugo Levy-Falk Date: Mon, 13 Jul 2026 22:25:25 +0200 Subject: tests: Add lint pass on the created rockspecs for the init command. --- spec/init_spec.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'spec/init_spec.lua') diff --git a/spec/init_spec.lua b/spec/init_spec.lua index 6cc0dd90..ae211706 100644 --- a/spec/init_spec.lua +++ b/spec/init_spec.lua @@ -6,7 +6,7 @@ local is_win = test_env.TEST_TARGET_OS == "windows" local write_file = test_env.write_file local lfs = require("lfs") -describe("luarocks init #integration", function() +describe("luarocks #init #integration", function() lazy_setup(function() test_env.setup_specs() @@ -31,6 +31,7 @@ describe("luarocks init #integration", function() assert.truthy(lfs.attributes(myproject .. "/.luarocks/config-" .. test_env.lua_version .. ".lua")) assert.truthy(lfs.attributes(myproject .. "/.gitignore")) assert.truthy(lfs.attributes(myproject .. "/myproject-dev-1.rockspec")) + assert.truthy(run.luarocks_bool("lint " .. myproject .. "/myproject-dev-1.rockspec")) end, finally) end) @@ -53,6 +54,7 @@ describe("luarocks init #integration", function() assert.truthy(lfs.attributes(myproject .. "/.luarocks/config-" .. test_env.lua_version .. ".lua")) assert.falsy(lfs.attributes(myproject .. "/.gitignore")) assert.truthy(lfs.attributes(myproject .. "/myproject-dev-1.rockspec")) + assert.truthy(run.luarocks_bool("lint " .. myproject .. "/myproject-dev-1.rockspec")) end, finally) end) @@ -72,6 +74,7 @@ describe("luarocks init #integration", function() assert.truthy(lfs.attributes(myproject .. "/.luarocks/config-" .. test_env.lua_version .. ".lua")) assert.truthy(lfs.attributes(myproject .. "/.gitignore")) assert.truthy(lfs.attributes(myproject .. "/myproject-dev-1.rockspec")) + assert.truthy(run.luarocks_bool("lint " .. myproject .. "/myproject-dev-1.rockspec")) end, finally) end) @@ -94,6 +97,7 @@ describe("luarocks init #integration", function() assert.truthy(lfs.attributes(myproject .. "/.luarocks/config-" .. test_env.lua_version .. ".lua")) assert.truthy(lfs.attributes(myproject .. "/.gitignore")) assert.truthy(lfs.attributes(myproject .. "/myproject-dev-1.rockspec")) + assert.truthy(run.luarocks_bool("lint " .. myproject .. "/myproject-dev-1.rockspec")) end, finally) end) @@ -144,6 +148,7 @@ describe("luarocks init #integration", function() assert(run.luarocks("init customname 1.0")) assert.truthy(lfs.attributes(myproject .. "/customname-1.0-1.rockspec")) + assert.truthy(run.luarocks_bool("lint " .. myproject .. "/customname-1.0-1.rockspec")) end, finally) end) @@ -160,6 +165,7 @@ describe("luarocks init #integration", function() local data = fd:read("*a") fd:close() assert.truthy(data:find("lua >= 5.1, < 5.6", 1, true)) + assert.truthy(run.luarocks_bool("lint " .. rockspec_name)) end, finally) end) @@ -175,6 +181,7 @@ describe("luarocks init #integration", function() assert.truthy(content:find("summary = \"Test repo\"")) assert.truthy(content:find("detailed = .+Test repo.+")) assert.truthy(content:find("license = \"MIT\"")) + assert.truthy(run.luarocks_bool("lint " .. myproject .. "/myproject-dev-1.rockspec")) fd = assert(io.open(myproject .. "/.gitignore", "r")) content = assert(fd:read("*a")) -- cgit v1.2.3-55-g6feb