From 2f67a04c91c5088d78d5f18013dded4f89382ff3 Mon Sep 17 00:00:00 2001 From: Hisham Date: Tue, 18 Oct 2016 17:59:19 -0400 Subject: Test case for issue #268 --- spec/install_spec.lua | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'spec') diff --git a/spec/install_spec.lua b/spec/install_spec.lua index 8857e4bd..45b3e2f9 100644 --- a/spec/install_spec.lua +++ b/spec/install_spec.lua @@ -18,7 +18,9 @@ local extra_rocks = { "/lxsh-0.8.6-2.rockspec", "/say-1.2-1.src.rock", "/say-1.0-1.src.rock", - "/wsapi-1.6-1.src.rock" + "/wsapi-1.6-1.src.rock", + "/luafilesystem-1.6.3-2.src.rock", + "/luafilesystem-1.6.1-1.src.rock", } describe("LuaRocks install tests #blackbox #b_install", function() @@ -81,6 +83,17 @@ describe("LuaRocks install tests #blackbox #b_install", function() end assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/luasec")) end) + + it('LuaRocks install - handle versioned modules when installing another version with --keep #268', function() + assert.is_true(run.luarocks_bool("install luafilesystem")) + assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/lua/"..env_variables.LUA_VERSION.."/lfs."..test_env.lib_extension)) + assert.is_true(run.luarocks_bool("install luafilesystem 1.6.1 --keep")) + assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/lua/"..env_variables.LUA_VERSION.."/lfs."..test_env.lib_extension)) + assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/lua/"..env_variables.LUA_VERSION.."/luafilesystem_1_6_1_1-lfs."..test_env.lib_extension)) + assert.is_true(run.luarocks_bool("install luafilesystem")) + assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/lua/"..env_variables.LUA_VERSION.."/lfs."..test_env.lib_extension)) + assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/lua/"..env_variables.LUA_VERSION.."/luafilesystem_1_6_1_1-lfs."..test_env.lib_extension)) + end) it("LuaRocks install only-deps of luasocket packed rock", function() assert.is_true(run.luarocks_bool("build --pack-binary-rock luasocket 3.0rc1-2")) -- cgit v1.2.3-55-g6feb