From 9c239f33a929d300a45b74cc968fb34ffd526150 Mon Sep 17 00:00:00 2001 From: Peter Melnichenko Date: Wed, 19 Oct 2016 22:57:44 +0300 Subject: Add a test for #302 --- spec/install_spec.lua | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'spec') diff --git a/spec/install_spec.lua b/spec/install_spec.lua index 2bbf4221..f068af76 100644 --- a/spec/install_spec.lua +++ b/spec/install_spec.lua @@ -21,6 +21,8 @@ local extra_rocks = { "/wsapi-1.6-1.src.rock", "/luafilesystem-1.6.3-2.src.rock", "/luafilesystem-1.6.3-1.src.rock", + "/luacheck-0.7.3-1.src.rock", + "/luacheck-0.8.0-1.src.rock", } describe("LuaRocks install tests #blackbox #b_install", function() @@ -87,13 +89,33 @@ describe("LuaRocks install tests #blackbox #b_install", function() 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.3-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_3_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_3_1-lfs."..test_env.lib_extension)) end) + + it('LuaRocks install - handle versioned modules and commands from different files when upgrading #302', function() + assert.is_true(run.luarocks_bool("install luacheck 0.7.3 --deps-mode=none")) + assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/share/lua/"..env_variables.LUA_VERSION.."/luacheck.lua")) + assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/bin/luacheck"..test_env.wrapper_extension)) + + assert.is_true(run.luarocks_bool("install luacheck 0.8.0 --deps-mode=none")) + assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/share/lua/"..env_variables.LUA_VERSION.."/luacheck/init.lua")) + assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/bin/luacheck"..test_env.wrapper_extension)) + assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/share/lua/"..env_variables.LUA_VERSION.."/luacheck_0_7_3_1-luacheck.lua")) + assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/bin/luacheck_0_7_3_1-luacheck"..test_env.wrapper_extension)) + + assert.is_true(run.luarocks_bool("install luacheck 0.7.3 --keep --deps-mode=none")) + assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/share/lua/"..env_variables.LUA_VERSION.."/luacheck/init.lua")) + assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/bin/luacheck"..test_env.wrapper_extension)) + assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/share/lua/"..env_variables.LUA_VERSION.."/luacheck_0_7_3_1-luacheck.lua")) + assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/bin/luacheck_0_7_3_1-luacheck"..test_env.wrapper_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