aboutsummaryrefslogtreecommitdiff
path: root/spec/quick/purge.q
diff options
context:
space:
mode:
Diffstat (limited to 'spec/quick/purge.q')
-rw-r--r--spec/quick/purge.q103
1 files changed, 103 insertions, 0 deletions
diff --git a/spec/quick/purge.q b/spec/quick/purge.q
new file mode 100644
index 00000000..a3f24b99
--- /dev/null
+++ b/spec/quick/purge.q
@@ -0,0 +1,103 @@
1SUITE: luarocks purge
2
3================================================================================
4TEST: needs a --tree argument
5RUN: luarocks purge
6EXIT: 1
7
8================================================================================
9TEST: missing tree
10RUN: luarocks purge --tree=missing-tree
11EXIT: 1
12
13================================================================================
14TEST: missing --tree argument
15RUN: luarocks purge --tree=
16EXIT: 1
17
18
19================================================================================
20TEST: runs
21
22FILE: testrock-1.0-1.rockspec
23--------------------------------------------------------------------------------
24package = "testrock"
25version = "1.0-1"
26source = {
27 url = "file://%{url(tmpdir)}/testrock.lua"
28}
29dependencies = {
30 "a_rock >= 0.8"
31}
32build = {
33 type = "builtin",
34 modules = {
35 testrock = "testrock.lua"
36 }
37}
38--------------------------------------------------------------------------------
39
40FILE: testrock.lua
41--------------------------------------------------------------------------------
42return {}
43--------------------------------------------------------------------------------
44
45RUN: luarocks build --only-server=%{fixtures_dir}/a_repo testrock-1.0-1.rockspec
46
47EXISTS: %{testing_sys_rocks}/testrock
48EXISTS: %{testing_sys_rocks}/a_rock
49
50RUN: luarocks purge --tree=%{testing_sys_tree}
51
52NOT_EXISTS: %{testing_sys_rocks}/testrock
53NOT_EXISTS: %{testing_sys_rocks}/a_rock
54
55
56
57================================================================================
58TEST: works with missing files
59
60FILE: testrock-1.0-1.rockspec
61--------------------------------------------------------------------------------
62package = "testrock"
63version = "1.0-1"
64source = {
65 url = "file://%{url(tmpdir)}/testrock.lua"
66}
67dependencies = {
68 "a_rock >= 0.8"
69}
70build = {
71 type = "builtin",
72 modules = {
73 testrock = "testrock.lua"
74 }
75}
76--------------------------------------------------------------------------------
77
78FILE: testrock.lua
79--------------------------------------------------------------------------------
80return {}
81--------------------------------------------------------------------------------
82
83RUN: luarocks build --only-server=%{fixtures_dir}/a_repo testrock-1.0-1.rockspec
84
85RMDIR: %{testing_sys_tree}/share/lua/%{lua_version}/testrock
86
87RUN: luarocks purge --tree=%{testing_sys_tree}
88
89NOT_EXISTS: %{testing_sys_rocks}/testrock
90NOT_EXISTS: %{testing_sys_rocks}/a_rock
91
92
93
94================================================================================
95TEST: --old-versions
96
97RUN: luarocks install --only-server=%{fixtures_dir}/a_repo a_rock 2.0
98RUN: luarocks install --only-server=%{fixtures_dir}/a_repo a_rock 1.0 --keep
99
100RUN: luarocks purge --old-versions --tree=%{testing_sys_tree}
101
102EXISTS: %{testing_sys_rocks}/a_rock/2.0-1
103NOT_EXISTS: %{testing_sys_rocks}/a_rock/1.0-1