aboutsummaryrefslogtreecommitdiff
path: root/spec/config_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'spec/config_spec.lua')
-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()