summaryrefslogtreecommitdiff
path: root/spec/unpack_spec.lua
diff options
context:
space:
mode:
authorHisham <hisham@gobolinux.org>2016-10-14 16:38:51 -0700
committerHisham <hisham@gobolinux.org>2016-10-14 16:38:51 -0700
commit075196e8b5d315888a8ae110fa9a18089044ae3b (patch)
treeeca3eb78c23f8d85dbe625564a2d66966d6281f1 /spec/unpack_spec.lua
parentdbca97cdcc15e386554b2631a0ae7aca02500abf (diff)
parent1fea0e3a0972bcc6b4319cd3d9e79834562486bc (diff)
downloadluarocks-075196e8b5d315888a8ae110fa9a18089044ae3b.tar.gz
luarocks-075196e8b5d315888a8ae110fa9a18089044ae3b.tar.bz2
luarocks-075196e8b5d315888a8ae110fa9a18089044ae3b.zip
Merge branch 'master' into luarocks-3
Diffstat (limited to 'spec/unpack_spec.lua')
-rw-r--r--spec/unpack_spec.lua12
1 files changed, 8 insertions, 4 deletions
diff --git a/spec/unpack_spec.lua b/spec/unpack_spec.lua
index 8db779c3..a0fc370d 100644
--- a/spec/unpack_spec.lua
+++ b/spec/unpack_spec.lua
@@ -1,14 +1,12 @@
1local test_env = require("test/test_environment") 1local test_env = require("test/test_environment")
2local run = test_env.run 2local run = test_env.run
3local testing_paths = test_env.testing_paths 3local testing_paths = test_env.testing_paths
4local lfs = require("lfs")
5 4
6test_env.unload_luarocks() 5test_env.unload_luarocks()
7 6
8local extra_rocks = { 7local extra_rocks = {
9 "/cprint-0.1-2.src.rock", 8 "/cprint-0.1-2.src.rock",
10 "/cprint-0.1-2.rockspec", 9 "/cprint-0.1-2.rockspec"
11 "/luazip-1.2.4-1.rockspec"
12} 10}
13 11
14describe("LuaRocks unpack tests #blackbox #b_unpack", function() 12describe("LuaRocks unpack tests #blackbox #b_unpack", function()
@@ -21,9 +19,11 @@ describe("LuaRocks unpack tests #blackbox #b_unpack", function()
21 it("LuaRocks unpack with no flags/arguments", function() 19 it("LuaRocks unpack with no flags/arguments", function()
22 assert.is_false(run.luarocks_bool("unpack")) 20 assert.is_false(run.luarocks_bool("unpack"))
23 end) 21 end)
22
24 it("LuaRocks unpack with invalid rockspec", function() 23 it("LuaRocks unpack with invalid rockspec", function()
25 assert.is_false(run.luarocks_bool("unpack invalid.rockspec")) 24 assert.is_false(run.luarocks_bool("unpack invalid.rockspec"))
26 end) 25 end)
26
27 it("LuaRocks unpack with invalid patch", function() 27 it("LuaRocks unpack with invalid patch", function()
28 assert.is_false(run.luarocks_bool("unpack " .. testing_paths.testing_dir .. "/testfiles/invalid_patch-0.1-1.rockspec")) 28 assert.is_false(run.luarocks_bool("unpack " .. testing_paths.testing_dir .. "/testfiles/invalid_patch-0.1-1.rockspec"))
29 end) 29 end)
@@ -34,19 +34,22 @@ describe("LuaRocks unpack tests #blackbox #b_unpack", function()
34 assert.is_true(run.luarocks_bool("unpack cprint")) 34 assert.is_true(run.luarocks_bool("unpack cprint"))
35 test_env.remove_dir("cprint-0.1-2") 35 test_env.remove_dir("cprint-0.1-2")
36 end) 36 end)
37
37 it("LuaRocks unpack src", function() 38 it("LuaRocks unpack src", function()
38 assert.is_true(run.luarocks_bool("download --source cprint")) 39 assert.is_true(run.luarocks_bool("download --source cprint"))
39 assert.is_true(run.luarocks_bool("unpack cprint-0.1-2.src.rock")) 40 assert.is_true(run.luarocks_bool("unpack cprint-0.1-2.src.rock"))
40 os.remove("cprint-0.1-2.src.rock") 41 os.remove("cprint-0.1-2.src.rock")
41 test_env.remove_dir("cprint-0.1-2") 42 test_env.remove_dir("cprint-0.1-2")
42 end) 43 end)
43 it("LuaRocks unpack rockspec", function() 44
45 it("LuaRocks unpack src", function()
44 assert.is_true(run.luarocks_bool("download --rockspec cprint")) 46 assert.is_true(run.luarocks_bool("download --rockspec cprint"))
45 assert.is_true(run.luarocks_bool("unpack cprint-0.1-2.rockspec")) 47 assert.is_true(run.luarocks_bool("unpack cprint-0.1-2.rockspec"))
46 os.remove("cprint-0.1-2.rockspec") 48 os.remove("cprint-0.1-2.rockspec")
47 os.remove("lua-cprint") 49 os.remove("lua-cprint")
48 test_env.remove_dir("cprint-0.1-2") 50 test_env.remove_dir("cprint-0.1-2")
49 end) 51 end)
52
50 -- #595 luarocks unpack of a git:// rockspec fails to copy the rockspec 53 -- #595 luarocks unpack of a git:// rockspec fails to copy the rockspec
51 it("LuaRocks unpack git:// rockspec", function() 54 it("LuaRocks unpack git:// rockspec", function()
52 assert.is_true(run.luarocks_bool("download --rockspec luazip")) 55 assert.is_true(run.luarocks_bool("download --rockspec luazip"))
@@ -54,6 +57,7 @@ describe("LuaRocks unpack tests #blackbox #b_unpack", function()
54 assert.is_truthy(lfs.attributes("luazip-1.2.4-1/luazip/luazip-1.2.4-1.rockspec")) 57 assert.is_truthy(lfs.attributes("luazip-1.2.4-1/luazip/luazip-1.2.4-1.rockspec"))
55 test_env.remove_dir("luazip-1.2.4-1") 58 test_env.remove_dir("luazip-1.2.4-1")
56 end) 59 end)
60
57 it("LuaRocks unpack binary", function() 61 it("LuaRocks unpack binary", function()
58 assert.is_true(run.luarocks_bool("build cprint")) 62 assert.is_true(run.luarocks_bool("build cprint"))
59 assert.is_true(run.luarocks_bool("pack cprint")) 63 assert.is_true(run.luarocks_bool("pack cprint"))