aboutsummaryrefslogtreecommitdiff
path: root/spec/pack_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'spec/pack_spec.lua')
-rw-r--r--spec/pack_spec.lua67
1 files changed, 2 insertions, 65 deletions
diff --git a/spec/pack_spec.lua b/spec/pack_spec.lua
index 20a2b3ef..2a2fb3a5 100644
--- a/spec/pack_spec.lua
+++ b/spec/pack_spec.lua
@@ -4,60 +4,10 @@ local run = test_env.run
4local testing_paths = test_env.testing_paths 4local testing_paths = test_env.testing_paths
5local write_file = test_env.write_file 5local write_file = test_env.write_file
6 6
7local extra_rocks = {
8 "/luassert-1.7.0-1.src.rock",
9 "/luasocket-${LUASOCKET}.src.rock",
10 "/luasocket-${LUASOCKET}.rockspec",
11 "/say-1.2-1.src.rock",
12 "/say-1.0-1.src.rock"
13}
14
15describe("luarocks pack #integration", function() 7describe("luarocks pack #integration", function()
16 8
17 before_each(function() 9 lazy_setup(function()
18 test_env.setup_specs(extra_rocks) 10 test_env.setup_specs()
19 end)
20
21 it("with no flags/arguments", function()
22 assert.is_false(run.luarocks_bool("pack"))
23 end)
24
25 it("basic", function()
26 assert(run.luarocks_bool("pack luacov"))
27 assert(test_env.remove_files(lfs.currentdir(), "luacov%-"))
28 end)
29
30 it("invalid rockspec", function()
31 assert.is_false(run.luarocks_bool("pack " .. testing_paths.fixtures_dir .. "/invalid_say-1.3-1.rockspec"))
32 end)
33
34 it("not installed rock", function()
35 assert.is_false(run.luarocks_bool("pack cjson"))
36 end)
37
38 it("not installed rock from non existing manifest", function()
39 assert.is_false(run.luarocks_bool("pack /non/exist/temp.manif"))
40 end)
41
42 it("detects latest version version of rock", function()
43 assert(run.luarocks_bool("install say 1.2"))
44 assert(run.luarocks_bool("install luassert"))
45 assert(run.luarocks_bool("install say 1.0"))
46 assert(run.luarocks_bool("pack say"))
47 assert.is_truthy(lfs.attributes("say-1.2-1.all.rock"))
48 assert(test_env.remove_files(lfs.currentdir(), "say%-"))
49 end)
50
51 pending("#gpg --sign", function()
52 assert(run.luarocks_bool("install say 1.2"))
53 assert(run.luarocks_bool("install luassert"))
54 assert(run.luarocks_bool("install say 1.0"))
55 os.delete("say-1.2-1.all.rock")
56 os.delete("say-1.2-1.all.rock.asc")
57 assert(run.luarocks_bool("pack say --sign"))
58 assert.is_truthy(lfs.attributes("say-1.2-1.all.rock"))
59 assert.is_truthy(lfs.attributes("say-1.2-1.all.rock.asc"))
60 assert(test_env.remove_files(lfs.currentdir(), "say%-"))
61 end) 11 end)
62 12
63 describe("#mock", function() 13 describe("#mock", function()
@@ -149,17 +99,4 @@ describe("luarocks pack #integration", function()
149 end) 99 end)
150 end) 100 end)
151 end) 101 end)
152
153 describe("#namespaces", function()
154 it("packs a namespaced rock", function()
155 finally(function()
156 os.remove("a_rock-2.0-1.all.rock")
157 end)
158 assert(run.luarocks_bool("build a_user/a_rock --server=" .. testing_paths.fixtures_dir .. "/a_repo" ))
159 assert(run.luarocks_bool("build a_rock --keep --server=" .. testing_paths.fixtures_dir .. "/a_repo" ))
160 assert(run.luarocks_bool("pack a_user/a_rock" ))
161 assert(lfs.attributes("a_rock-2.0-1.all.rock"))
162 end)
163 end)
164
165end) 102end)