aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2020-09-23 12:14:58 -0300
committerGitHub <noreply@github.com>2020-09-23 12:14:58 -0300
commit0cf93c431c5ff251324c7f6b875d9d56feeb3cad (patch)
tree8c0cea6ebc0325a788a868b7835db9e95b8d02a3 /spec
parentf162d2ec3ca13d9e757db9dd6eb0f13979bac74b (diff)
downloadluarocks-0cf93c431c5ff251324c7f6b875d9d56feeb3cad.tar.gz
luarocks-0cf93c431c5ff251324c7f6b875d9d56feeb3cad.tar.bz2
luarocks-0cf93c431c5ff251324c7f6b875d9d56feeb3cad.zip
Support --pin and --only-deps together (#1222)
Diffstat (limited to 'spec')
-rw-r--r--spec/build_spec.lua36
1 files changed, 36 insertions, 0 deletions
diff --git a/spec/build_spec.lua b/spec/build_spec.lua
index 4843ed73..7d18ae4c 100644
--- a/spec/build_spec.lua
+++ b/spec/build_spec.lua
@@ -237,6 +237,42 @@ describe("LuaRocks build #integration", function()
237 end) 237 end)
238 end) 238 end)
239 239
240 it("supports --pin --only-deps #pinning", function()
241 test_env.run_in_tmp(function(tmpdir)
242 write_file("test-1.0-1.rockspec", [[
243 package = "test"
244 version = "1.0-1"
245 source = {
246 url = "file://]] .. tmpdir:gsub("\\", "/") .. [[/test.lua"
247 }
248 dependencies = {
249 "a_rock >= 0.8"
250 }
251 build = {
252 type = "builtin",
253 modules = {
254 test = "test.lua"
255 }
256 }
257 ]], finally)
258 write_file("test.lua", "return {}", finally)
259
260 assert.is_true(run.luarocks_bool("build --server=" .. testing_paths.fixtures_dir .. "/a_repo test-1.0-1.rockspec --pin --only-deps --tree=lua_modules"))
261 assert.is.falsy(lfs.attributes("./lua_modules/lib/luarocks/rocks-" .. test_env.lua_version .. "/test/1.0-1/test-1.0-1.rockspec"))
262 assert.is.truthy(lfs.attributes("./lua_modules/lib/luarocks/rocks-" .. test_env.lua_version .. "/a_rock/2.0-1/a_rock-2.0-1.rockspec"))
263 assert.is.truthy(lfs.attributes("./luarocks.lock"))
264 local lockfilename = "./luarocks.lock"
265 assert.is.truthy(lfs.attributes(lockfilename))
266 local lockdata = loadfile(lockfilename)()
267 assert.same({
268 dependencies = {
269 ["a_rock"] = "2.0-1",
270 ["lua"] = test_env.lua_version .. "-1",
271 }
272 }, lockdata)
273 end)
274 end)
275
240 it("lmathx deps partial match", function() 276 it("lmathx deps partial match", function()
241 assert.is_true(run.luarocks_bool("build lmathx")) 277 assert.is_true(run.luarocks_bool("build lmathx"))
242 278