From a9e5469bcd85e0627576e56ff07aa17203954c31 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Tue, 19 Dec 2017 12:43:53 -0200 Subject: Tests: add regression test for #750 Fix #750. --- spec/purge_spec.lua | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'spec') diff --git a/spec/purge_spec.lua b/spec/purge_spec.lua index 09a9d433..20cee5f0 100644 --- a/spec/purge_spec.lua +++ b/spec/purge_spec.lua @@ -4,9 +4,13 @@ local testing_paths = test_env.testing_paths test_env.unload_luarocks() +local extra_rocks = { + "/say-1.0-1.src.rock", +} + describe("LuaRocks purge tests #blackbox #b_purge", function() before_each(function() - test_env.setup_specs() + test_env.setup_specs(extra_rocks) end) describe("LuaRocks purge basic tests", function() @@ -14,11 +18,17 @@ describe("LuaRocks purge tests #blackbox #b_purge", function() assert.is_false(run.luarocks_bool("purge --tree=" .. testing_paths.testing_tree)) end) it("LuaRocks purge tree with no string", function() - assert.is_false(run.luarocks_bool("purge --tree=1")) + assert.is_false(run.luarocks_bool("purge --tree=")) end) it("LuaRocks purge tree with no string", function() assert.is_true(run.luarocks_bool("purge --tree=" .. testing_paths.testing_sys_tree)) end) + it("LuaRocks purge tree missing files", function() + assert.is_true(run.luarocks_bool("install say 1.0")) + test_env.remove_dir(testing_paths.testing_sys_tree .. "/share/lua/"..test_env.lua_version.."/say") + assert.is_true(run.luarocks_bool("purge --tree=" .. testing_paths.testing_sys_tree)) + assert.is_false(test_env.exists(testing_paths.testing_sys_rocks .. "/say")) + end) it("LuaRocks purge old versions tree", function() assert.is_true(run.luarocks_bool("purge --old-versions --tree=" .. testing_paths.testing_sys_tree)) end) -- cgit v1.2.3-55-g6feb