diff options
Diffstat (limited to 'spec/upload_spec.lua')
-rw-r--r-- | spec/upload_spec.lua | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/spec/upload_spec.lua b/spec/upload_spec.lua index c10ef0e9..c68a1cdf 100644 --- a/spec/upload_spec.lua +++ b/spec/upload_spec.lua | |||
@@ -1,10 +1,26 @@ | |||
1 | local test_env = require("test/test_environment") | 1 | local test_env = require("test/test_environment") |
2 | local run = test_env.run | 2 | local run = test_env.run |
3 | local testing_paths = test_env.testing_paths | ||
3 | 4 | ||
4 | test_env.unload_luarocks() | 5 | test_env.unload_luarocks() |
5 | 6 | ||
6 | local extra_rocks = { | 7 | local extra_rocks = { |
7 | "/lua-cjson-2.1.0-1.src.rock" | 8 | "/lua-cjson-2.1.0-1.src.rock", |
9 | |||
10 | -- rocks needed for mock-server | ||
11 | "/copas-2.0.1-1.src.rock", | ||
12 | "/coxpcall-1.16.0-1.src.rock", | ||
13 | "/dkjson-2.5-2.src.rock", | ||
14 | "/luafilesystem-1.6.3-1.src.rock", | ||
15 | "/luasec-0.6-1.rockspec", | ||
16 | "/luasocket-3.0rc1-2.src.rock", | ||
17 | "/luasocket-3.0rc1-2.rockspec", | ||
18 | "/restserver-0.1-1.src.rock", | ||
19 | "/restserver-xavante-0.2-1.src.rock", | ||
20 | "/rings-1.3.0-1.src.rock", | ||
21 | "/wsapi-1.6.1-1.src.rock", | ||
22 | "/wsapi-xavante-1.6.1-1.src.rock", | ||
23 | "/xavante-2.4.0-1.src.rock" | ||
8 | } | 24 | } |
9 | 25 | ||
10 | describe("LuaRocks upload tests #blackbox #b_upload", function() | 26 | describe("LuaRocks upload tests #blackbox #b_upload", function() |
@@ -34,6 +50,25 @@ describe("LuaRocks upload tests #blackbox #b_upload", function() | |||
34 | assert.is_false(run.luarocks_bool("upload --api-key=\"invalid\" --force luacov-0.11.0-1.rockspec")) | 50 | assert.is_false(run.luarocks_bool("upload --api-key=\"invalid\" --force luacov-0.11.0-1.rockspec")) |
35 | assert.is_true(run.luarocks_bool("install lua-cjson")) | 51 | assert.is_true(run.luarocks_bool("install lua-cjson")) |
36 | end) | 52 | end) |
53 | |||
54 | describe("LuaRocks upload tests with Xavante server #mock", function() | ||
55 | before_each(function() | ||
56 | assert.is.truthy(test_env.need_rock("restserver-xavante")) | ||
57 | local final_command = test_env.execute_helper(testing_paths.lua .. " " .. testing_paths.testing_dir .. "/mock-server.lua &", true, test_env.env_variables) | ||
58 | os.execute(final_command) | ||
59 | end) | ||
60 | |||
61 | after_each(function() | ||
62 | os.execute("curl localhost:8080/shutdown") | ||
63 | end) | ||
64 | |||
65 | it("LuaRocks upload rockspec with api-key", function() | ||
66 | assert.is_true(run.luarocks_bool("upload " .. testing_paths.testing_server .. "/luasocket-3.0rc1-2.rockspec --api-key=123", {LUAROCKS_CONFIG = testing_paths.testing_dir .. "/luarocks_site.lua"})) | ||
67 | end) | ||
68 | it("LuaRocks upload rockspec with api-key and skip-pack", function() | ||
69 | assert.is_true(run.luarocks_bool("upload --skip-pack " .. testing_paths.testing_server .. "/luasocket-3.0rc1-2.rockspec --api-key=123", {LUAROCKS_CONFIG = testing_paths.testing_dir .. "/luarocks_site.lua"})) | ||
70 | end) | ||
71 | end) | ||
37 | end) | 72 | end) |
38 | 73 | ||
39 | 74 | ||