aboutsummaryrefslogtreecommitdiff
path: root/spec/upload_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--spec/upload_spec.lua41
1 files changed, 41 insertions, 0 deletions
diff --git a/spec/upload_spec.lua b/spec/upload_spec.lua
new file mode 100644
index 00000000..daf40d61
--- /dev/null
+++ b/spec/upload_spec.lua
@@ -0,0 +1,41 @@
1local test_env = require("test/test_environment")
2local lfs = require("lfs")
3
4test_env.unload_luarocks()
5local upload = require("luarocks.upload")
6
7local extra_rocks = {
8 "/lua-cjson-2.1.0-1.src.rock"
9}
10
11expose("LuaRocks upload tests #blackbox #b_upload", function()
12
13 before_each(function()
14 test_env.setup_specs(extra_rocks)
15 run = test_env.run
16 end)
17
18 it("LuaRocks upload with no flags/arguments", function()
19 assert.is_false(run.luarocks_bool("upload"))
20 end)
21
22 it("LuaRocks upload invalid rockspec", function()
23 assert.is_false(run.luarocks_bool("upload invalid.rockspec"))
24 end)
25
26 it("LuaRocks upload api key invalid", function()
27 assert.is_false(run.luarocks_bool("upload --api-key=invalid invalid.rockspec"))
28 end)
29
30 it("LuaRocks upload api key invalid and skip-pack", function()
31 assert.is_false(run.luarocks_bool("upload --api-key=\"invalid\" --skip-pack luacov-0.11.0-1.rockspec"))
32 end)
33
34 it("LuaRocks upload force", function()
35 assert.is_true(run.luarocks_bool("install lua-cjson"))
36 assert.is_false(run.luarocks_bool("upload --api-key=\"invalid\" --force luacov-0.11.0-1.rockspec"))
37 assert.is_true(run.luarocks_bool("install lua-cjson"))
38 end)
39end)
40
41