From f76b7a2b13e411df2e696146bb0a6396781acd92 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Thu, 29 Feb 2024 00:46:06 -0300 Subject: tests: speed up and simplify --- spec/install_spec.lua | 35 ----------------------------------- 1 file changed, 35 deletions(-) (limited to 'spec/install_spec.lua') diff --git a/spec/install_spec.lua b/spec/install_spec.lua index b4b064f0..66000c36 100644 --- a/spec/install_spec.lua +++ b/spec/install_spec.lua @@ -142,41 +142,6 @@ describe("luarocks install #integration", function() assert.is_true(os.remove("luasocket-${LUASOCKET}." .. test_env.platform .. ".rock")) end) - it("installation rolls back on failure", function() - if test_env.TYPE_TEST_ENV ~= "full" then - assert.is_true(run.luarocks_bool("build --pack-binary-rock luasocket ${LUASOCKET}")) - local luadir = testing_paths.testing_sys_tree .. "/share/lua/"..env_variables.LUA_VERSION - lfs.mkdir(luadir) - - run.luarocks_bool("remove " .. "luasocket") - - -- create a file where a folder should be - local fd = io.open(luadir .. "/socket", "w") - fd:write("\n") - fd:close() - - -- try to install and fail - assert.is_false(run.luarocks_bool("install " .. "luasocket-${LUASOCKET}." .. test_env.platform .. ".rock")) - - -- file is still there - assert.is.truthy(lfs.attributes(luadir .. "/socket")) - -- no left overs from failed installation - assert.is.falsy(lfs.attributes(luadir .. "/mime.lua")) - - -- remove file - assert.is_true(os.remove(luadir .. "/socket")) - - -- try again and succeed - assert.is_true(run.luarocks_bool("install " .. "luasocket-${LUASOCKET}." .. test_env.platform .. ".rock")) - - -- files installed successfully - assert.is.truthy(lfs.attributes(luadir .. "/socket/ftp.lua")) - assert.is.truthy(lfs.attributes(luadir .. "/mime.lua")) - - assert.is_true(os.remove("luasocket-${LUASOCKET}." .. test_env.platform .. ".rock")) - end - end) - it("binary rock of cprint", function() assert.is_true(run.luarocks_bool("build --pack-binary-rock cprint")) assert.is_true(run.luarocks_bool("install cprint-${CPRINT}." .. test_env.platform .. ".rock")) -- cgit v1.2.3-55-g6feb