aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorFYP <its.fyp@gmail.com>2018-10-21 20:46:36 +0300
committerHisham Muhammad <hisham@gobolinux.org>2018-10-29 19:21:40 -0300
commit0c534c71465474b92710a2951bf15370fcc8c663 (patch)
tree4997ff7d01c747432e1a9b53518d533e3b12357b /spec
parent8b60d7440ce6f215c7ea480950e4df5d190992f0 (diff)
downloadluarocks-0c534c71465474b92710a2951bf15370fcc8c663.tar.gz
luarocks-0c534c71465474b92710a2951bf15370fcc8c663.tar.bz2
luarocks-0c534c71465474b92710a2951bf15370fcc8c663.zip
cmd: fix setting up deployment paths from a tree
(Amended with a regression test.) Co-authored-by: Hisham Muhammad <hisham@gobolinux.org>
Diffstat (limited to 'spec')
-rw-r--r--spec/config_spec.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/config_spec.lua b/spec/config_spec.lua
index f415909d..defc1d2f 100644
--- a/spec/config_spec.lua
+++ b/spec/config_spec.lua
@@ -3,6 +3,7 @@ local lfs = require("lfs")
3local run = test_env.run 3local run = test_env.run
4local testing_paths = test_env.testing_paths 4local testing_paths = test_env.testing_paths
5local env_variables = test_env.env_variables 5local env_variables = test_env.env_variables
6local write_file = test_env.write_file
6local hardcoded 7local hardcoded
7 8
8test_env.unload_luarocks() 9test_env.unload_luarocks()
@@ -52,6 +53,22 @@ describe("LuaRocks config tests #integration", function()
52 local output = run.luarocks("config --user-config", {LUAROCKS_CONFIG = "missing_file.lua"}) 53 local output = run.luarocks("config --user-config", {LUAROCKS_CONFIG = "missing_file.lua"})
53 assert.truthy(output:match("Warning")) 54 assert.truthy(output:match("Warning"))
54 end) 55 end)
56
57 it("LuaRocks config with --tree respects custom config", function()
58 write_file("my_config.lua", [[
59 rocks_trees = {
60 {
61 name = "system",
62 root = "/example/tree",
63 lua_dir = "/example/luadir",
64 },
65 }
66 ]], finally)
67 local output = run.luarocks("config", {LUAROCKS_CONFIG = "my_config.lua"})
68 assert.match([[deploy_lua_dir = "/example/luadir"]], output)
69 output = run.luarocks("config --tree=system", {LUAROCKS_CONFIG = "my_config.lua"})
70 assert.match([[deploy_lua_dir = "/example/luadir"]], output)
71 end)
55 end) 72 end)
56 73
57 describe("LuaRocks config - more complex tests", function() 74 describe("LuaRocks config - more complex tests", function()