diff options
Diffstat (limited to 'spec/install_spec.lua')
-rw-r--r-- | spec/install_spec.lua | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/spec/install_spec.lua b/spec/install_spec.lua index bf50ced7..76dc2201 100644 --- a/spec/install_spec.lua +++ b/spec/install_spec.lua | |||
@@ -267,6 +267,50 @@ describe("luarocks install #integration", function() | |||
267 | end) | 267 | end) |
268 | end) | 268 | end) |
269 | 269 | ||
270 | it("respects luarocks.lock in package #pinning", function() | ||
271 | test_env.run_in_tmp(function(tmpdir) | ||
272 | write_file("test-1.0-1.rockspec", [[ | ||
273 | package = "test" | ||
274 | version = "1.0-1" | ||
275 | source = { | ||
276 | url = "file://]] .. tmpdir:gsub("\\", "/") .. [[/test.lua" | ||
277 | } | ||
278 | dependencies = { | ||
279 | "a_rock >= 0.8" | ||
280 | } | ||
281 | build = { | ||
282 | type = "builtin", | ||
283 | modules = { | ||
284 | test = "test.lua" | ||
285 | } | ||
286 | } | ||
287 | ]], finally) | ||
288 | write_file("test.lua", "return {}", finally) | ||
289 | write_file("luarocks.lock", [[ | ||
290 | return { | ||
291 | dependencies = { | ||
292 | ["a_rock"] = "1.0-1", | ||
293 | } | ||
294 | } | ||
295 | ]], finally) | ||
296 | |||
297 | assert.is_true(run.luarocks_bool("make --pack-binary-rock --server=" .. testing_paths.fixtures_dir .. "/a_repo test-1.0-1.rockspec")) | ||
298 | assert.is_true(os.remove("luarocks.lock")) | ||
299 | |||
300 | assert.is.truthy(lfs.attributes("./test-1.0-1.all.rock")) | ||
301 | |||
302 | assert.is.falsy(lfs.attributes("./lua_modules/lib/luarocks/rocks-" .. test_env.lua_version .. "/test/1.0-1/test-1.0-1.rockspec")) | ||
303 | assert.is.falsy(lfs.attributes("./lua_modules/lib/luarocks/rocks-" .. test_env.lua_version .. "/a_rock/1.0-1/a_rock-1.0-1.rockspec")) | ||
304 | |||
305 | print(run.luarocks("install ./test-1.0-1.all.rock --tree=lua_modules --server=" .. testing_paths.fixtures_dir .. "/a_repo")) | ||
306 | |||
307 | assert.is.truthy(lfs.attributes("./lua_modules/lib/luarocks/rocks-" .. test_env.lua_version .. "/test/1.0-1/test-1.0-1.rockspec")) | ||
308 | assert.is.truthy(lfs.attributes("./lua_modules/lib/luarocks/rocks-" .. test_env.lua_version .. "/test/1.0-1/luarocks.lock")) | ||
309 | assert.is.truthy(lfs.attributes("./lua_modules/lib/luarocks/rocks-" .. test_env.lua_version .. "/a_rock/1.0-1/a_rock-1.0-1.rockspec")) | ||
310 | assert.is.falsy(lfs.attributes("./lua_modules/lib/luarocks/rocks-" .. test_env.lua_version .. "/a_rock/2.0-1")) | ||
311 | end) | ||
312 | end) | ||
313 | |||
270 | describe("#unix install runs build from #git", function() | 314 | describe("#unix install runs build from #git", function() |
271 | local git | 315 | local git |
272 | 316 | ||