aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2018-01-05 15:38:37 -0200
committerHisham Muhammad <hisham@gobolinux.org>2018-01-05 15:38:37 -0200
commit98a0bd9a97190be8ba10f14a3d67e42de827b04a (patch)
tree079b71a6416b62a5d9ab61a5a4f47e340d353831 /spec
parent291c34696daa496d4ceb1e58b282fa935d90a3f5 (diff)
downloadluarocks-98a0bd9a97190be8ba10f14a3d67e42de827b04a.tar.gz
luarocks-98a0bd9a97190be8ba10f14a3d67e42de827b04a.tar.bz2
luarocks-98a0bd9a97190be8ba10f14a3d67e42de827b04a.zip
path: use versioned LUA_xPATH_5_x variables
`luarocks path` now exports versioned variables `LUA_PATH_5_x` and `LUA_CPATH_5_x` instead of `LUA_PATH` and `LUA_CPATH` when those are in use in your system. Fixes #760.
Diffstat (limited to 'spec')
-rw-r--r--spec/path_spec.lua34
1 files changed, 34 insertions, 0 deletions
diff --git a/spec/path_spec.lua b/spec/path_spec.lua
index 22f07591..536233b1 100644
--- a/spec/path_spec.lua
+++ b/spec/path_spec.lua
@@ -8,6 +8,40 @@ describe("LuaRocks path tests #blackbox #b_path", function()
8 test_env.setup_specs() 8 test_env.setup_specs()
9 end) 9 end)
10 10
11 it("LuaRocks path", function()
12 local output = run.luarocks("path")
13 assert.match("LUA_PATH=", output)
14 assert.match("LUA_CPATH=", output)
15 end)
16
17 if _VERSION:match("[23]") then
18 local v = _VERSION:gsub("Lua (%d+)%.(%d+)", "%1_%2")
19
20 it("LuaRocks path with LUA_PATH_"..v, function()
21 local output = run.luarocks("path", {
22 ["LUA_PATH_"..v] = package.path,
23 })
24 assert.match("LUA_PATH_"..v.."=", output)
25 end)
26
27 it("LuaRocks path with LUA_CPATH_"..v, function()
28 local output = run.luarocks("path", {
29 ["LUA_CPATH_"..v] = package.cpath,
30 })
31 assert.match("LUA_CPATH_"..v.."=", output)
32 end)
33
34 it("LuaRocks path with LUA_PATH_"..v.." and LUA_CPATH_"..v, function()
35 local output = run.luarocks("path", {
36 ["LUA_PATH_"..v] = package.path,
37 ["LUA_CPATH_"..v] = package.cpath,
38 })
39 assert.match("LUA_PATH_"..v.."=", output)
40 assert.match("LUA_CPATH_"..v.."=", output)
41 end)
42
43 end
44
11 it("LuaRocks path bin", function() 45 it("LuaRocks path bin", function()
12 assert.is_true(run.luarocks_bool("path --bin")) 46 assert.is_true(run.luarocks_bool("path --bin"))
13 end) 47 end)