aboutsummaryrefslogtreecommitdiff
path: root/spec/build_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'spec/build_spec.lua')
-rw-r--r--spec/build_spec.lua49
1 files changed, 49 insertions, 0 deletions
diff --git a/spec/build_spec.lua b/spec/build_spec.lua
index ad6f4d42..2e139a41 100644
--- a/spec/build_spec.lua
+++ b/spec/build_spec.lua
@@ -417,6 +417,55 @@ describe("LuaRocks build #integration", function()
417 assert.is.truthy(run.luarocks("show uses_luaversion_variable")) 417 assert.is.truthy(run.luarocks("show uses_luaversion_variable"))
418 end, finally) 418 end, finally)
419 end) 419 end)
420
421
422 it("dependency directory is not provided for old format", function()
423 test_env.run_in_tmp(function(tmpdir)
424 local rocks_tree = run.luarocks("config variables.ROCKS_TREE")
425 local rocks_path = table.concat({rocks_tree, "a_rock", "1.0-1"}, package.config:sub(1, 1))
426 write_file("verify_argument.lua", string.format("assert(arg[1] == %q)", rocks_path))
427 write_file("uses_rockdir_variable-3.1-11.rockspec", [[
428 package = "uses_rockdir_variable"
429 version = "3.1-11"
430 source = {
431 url = "file://]] .. tmpdir:gsub("\\", "/") .. [[/verify_argument.lua"
432 }
433 dependencies = {
434 "a_rock 1.0"
435 }
436 build = {
437 type = "command",
438 build_command = "$(LUA) verify_argument.lua $(A_ROCK_ROCKDIR)",
439 }
440 ]])
441 assert.is_false(run.luarocks_bool("build uses_rockdir_variable-3.1-11.rockspec"))
442 end, finally)
443 end)
444
445 it("dependency directory is provided as variable", function()
446 test_env.run_in_tmp(function(tmpdir)
447 local rocks_tree = run.luarocks("config variables.ROCKS_TREE")
448 local rocks_path = table.concat({rocks_tree, "a_rock", "1.0-1"}, package.config:sub(1, 1))
449 write_file("verify_argument.lua", string.format("assert(arg[1] == %q)", rocks_path))
450 write_file("uses_rockdir_variable-3.1-11.rockspec", [[
451 rockspec_format = "3.1"
452 package = "uses_rockdir_variable"
453 version = "3.1-11"
454 source = {
455 url = "file://]] .. tmpdir:gsub("\\", "/") .. [[/verify_argument.lua"
456 }
457 dependencies = {
458 "a_rock 1.0"
459 }
460 build = {
461 type = "command",
462 build_command = "$(LUA) verify_argument.lua $(A_ROCK_ROCKDIR)",
463 }
464 ]])
465 assert.is_truthy(run.luarocks_bool("build uses_rockdir_variable-3.1-11.rockspec"))
466 assert.is.truthy(run.luarocks("show uses_rockdir_variable"))
467 end, finally)
468 end)
420 end) 469 end)
421 470
422 describe("#mock external dependencies", function() 471 describe("#mock external dependencies", function()