aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2020-07-21 11:05:11 -0300
committerHisham Muhammad <hisham@gobolinux.org>2020-07-21 11:05:11 -0300
commit6a11f673d02145ffe03aea173817ea9ab566f784 (patch)
treef4e5f53b1a46a6a948d79de2cb285dfd819af46d /spec
parent84df9d00723738e7bfa1fd0045104e9c521a8df8 (diff)
downloadluarocks-6a11f673d02145ffe03aea173817ea9ab566f784.tar.gz
luarocks-6a11f673d02145ffe03aea173817ea9ab566f784.tar.bz2
luarocks-6a11f673d02145ffe03aea173817ea9ab566f784.zip
tests: check that builtin auto-reads lua/ when modules table is empty
Test case for issue reported at https://github.com/Kong/kong/issues/5017
Diffstat (limited to 'spec')
-rw-r--r--spec/build_spec.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/build_spec.lua b/spec/build_spec.lua
index e498509f..4843ed73 100644
--- a/spec/build_spec.lua
+++ b/spec/build_spec.lua
@@ -547,6 +547,27 @@ describe("LuaRocks build #unit", function()
547 end) 547 end)
548 548
549 describe("build.builtin", function() 549 describe("build.builtin", function()
550 it("builtin auto installs files in lua subdir", function()
551 test_env.run_in_tmp(function(tmpdir)
552 lfs.mkdir("lua")
553 write_file("lua_module-1.0-1.rockspec", [[
554 package = "lua_module"
555 version = "1.0-1"
556 source = {
557 url = "http://example.com/lua_module"
558 }
559 build = {
560 type = "builtin",
561 modules = {}
562 }
563 ]], finally)
564 write_file("lua/lua_module.lua", "return 123", finally)
565
566 assert.is_true(run.luarocks_bool("build"))
567 assert.match("[\\/]lua_module%.lua", run.luarocks("show lua_module"))
568 end, finally)
569 end)
570
550 describe("builtin.autodetect_external_dependencies", function() 571 describe("builtin.autodetect_external_dependencies", function()
551 it("returns false if the given build table has no external dependencies", function() 572 it("returns false if the given build table has no external dependencies", function()
552 local build_table = { 573 local build_table = {