diff options
Diffstat (limited to '')
-rw-r--r-- | spec/purge_spec.lua | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/purge_spec.lua b/spec/purge_spec.lua new file mode 100644 index 00000000..639f96f3 --- /dev/null +++ b/spec/purge_spec.lua | |||
@@ -0,0 +1,30 @@ | |||
1 | local test_env = require("test/test_environment") | ||
2 | local lfs = require("lfs") | ||
3 | |||
4 | test_env.unload_luarocks() | ||
5 | local purge = require("luarocks.purge") | ||
6 | |||
7 | expose("LuaRocks purge tests #blackbox #b_purge", function() | ||
8 | before_each(function() | ||
9 | test_env.setup_specs(extra_rocks) | ||
10 | testing_paths = test_env.testing_paths | ||
11 | run = test_env.run | ||
12 | end) | ||
13 | |||
14 | describe("LuaRocks purge basic tests", function() | ||
15 | it("LuaRocks purge missing tree", function() | ||
16 | assert.is_false(run.luarocks_bool("purge --tree=" .. testing_paths.testing_tree)) | ||
17 | end) | ||
18 | it("LuaRocks purge tree with no string", function() | ||
19 | assert.is_false(run.luarocks_bool("purge --tree=1")) | ||
20 | end) | ||
21 | it("LuaRocks purge tree with no string", function() | ||
22 | assert.is_true(run.luarocks_bool("purge --tree=" .. testing_paths.testing_sys_tree)) | ||
23 | end) | ||
24 | it("LuaRocks purge old versions tree", function() | ||
25 | assert.is_true(run.luarocks_bool("purge --old-versions --tree=" .. testing_paths.testing_sys_tree)) | ||
26 | end) | ||
27 | end) | ||
28 | end) | ||
29 | |||
30 | |||