aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2017-12-19 12:43:53 -0200
committerHisham Muhammad <hisham@gobolinux.org>2017-12-19 12:43:53 -0200
commita9e5469bcd85e0627576e56ff07aa17203954c31 (patch)
tree367ca3d85c97b7bf178c4cb42037c7fae76ccd7f /spec
parenta070e326aa3d412a62b9ebdc9c22afd1da63843f (diff)
downloadluarocks-a9e5469bcd85e0627576e56ff07aa17203954c31.tar.gz
luarocks-a9e5469bcd85e0627576e56ff07aa17203954c31.tar.bz2
luarocks-a9e5469bcd85e0627576e56ff07aa17203954c31.zip
Tests: add regression test for #750
Fix #750.
Diffstat (limited to 'spec')
-rw-r--r--spec/purge_spec.lua14
1 files changed, 12 insertions, 2 deletions
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
4 4
5test_env.unload_luarocks() 5test_env.unload_luarocks()
6 6
7local extra_rocks = {
8 "/say-1.0-1.src.rock",
9}
10
7describe("LuaRocks purge tests #blackbox #b_purge", function() 11describe("LuaRocks purge tests #blackbox #b_purge", function()
8 before_each(function() 12 before_each(function()
9 test_env.setup_specs() 13 test_env.setup_specs(extra_rocks)
10 end) 14 end)
11 15
12 describe("LuaRocks purge basic tests", function() 16 describe("LuaRocks purge basic tests", function()
@@ -14,11 +18,17 @@ describe("LuaRocks purge tests #blackbox #b_purge", function()
14 assert.is_false(run.luarocks_bool("purge --tree=" .. testing_paths.testing_tree)) 18 assert.is_false(run.luarocks_bool("purge --tree=" .. testing_paths.testing_tree))
15 end) 19 end)
16 it("LuaRocks purge tree with no string", function() 20 it("LuaRocks purge tree with no string", function()
17 assert.is_false(run.luarocks_bool("purge --tree=1")) 21 assert.is_false(run.luarocks_bool("purge --tree="))
18 end) 22 end)
19 it("LuaRocks purge tree with no string", function() 23 it("LuaRocks purge tree with no string", function()
20 assert.is_true(run.luarocks_bool("purge --tree=" .. testing_paths.testing_sys_tree)) 24 assert.is_true(run.luarocks_bool("purge --tree=" .. testing_paths.testing_sys_tree))
21 end) 25 end)
26 it("LuaRocks purge tree missing files", function()
27 assert.is_true(run.luarocks_bool("install say 1.0"))
28 test_env.remove_dir(testing_paths.testing_sys_tree .. "/share/lua/"..test_env.lua_version.."/say")
29 assert.is_true(run.luarocks_bool("purge --tree=" .. testing_paths.testing_sys_tree))
30 assert.is_false(test_env.exists(testing_paths.testing_sys_rocks .. "/say"))
31 end)
22 it("LuaRocks purge old versions tree", function() 32 it("LuaRocks purge old versions tree", function()
23 assert.is_true(run.luarocks_bool("purge --old-versions --tree=" .. testing_paths.testing_sys_tree)) 33 assert.is_true(run.luarocks_bool("purge --old-versions --tree=" .. testing_paths.testing_sys_tree))
24 end) 34 end)