aboutsummaryrefslogtreecommitdiff
path: root/spec/upload_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--spec/upload_spec.lua29
1 files changed, 4 insertions, 25 deletions
diff --git a/spec/upload_spec.lua b/spec/upload_spec.lua
index 4091bbc9..cf915eb3 100644
--- a/spec/upload_spec.lua
+++ b/spec/upload_spec.lua
@@ -1,25 +1,11 @@
1local test_env = require("test/test_environment") 1local test_env = require("test/test_environment")
2local test_mock_server = require("test/test_mock_server")
2local run = test_env.run 3local run = test_env.run
3local testing_paths = test_env.testing_paths 4local testing_paths = test_env.testing_paths
4 5
5test_env.unload_luarocks() 6test_env.unload_luarocks()
6 7
7local extra_rocks = { 8local extra_rocks = test_mock_server.extra_rocks()
8 -- rocks needed for mock-server
9 "/copas-2.0.1-1.src.rock",
10 "/coxpcall-1.16.0-1.src.rock",
11 "/dkjson-2.5-2.src.rock",
12 "/luafilesystem-1.6.3-1.src.rock",
13 "/luasec-0.6-1.rockspec",
14 "/luasocket-3.0rc1-2.src.rock",
15 "/luasocket-3.0rc1-2.rockspec",
16 "/restserver-0.1-1.src.rock",
17 "/restserver-xavante-0.2-1.src.rock",
18 "/rings-1.3.0-1.src.rock",
19 "/wsapi-1.6.1-1.src.rock",
20 "/wsapi-xavante-1.6.1-1.src.rock",
21 "/xavante-2.4.0-1.src.rock"
22}
23 9
24describe("LuaRocks upload tests #blackbox #b_upload", function() 10describe("LuaRocks upload tests #blackbox #b_upload", function()
25 11
@@ -49,15 +35,9 @@ describe("LuaRocks upload tests #blackbox #b_upload", function()
49 end) 35 end)
50 36
51 describe("LuaRocks upload tests with Xavante server #mock", function() 37 describe("LuaRocks upload tests with Xavante server #mock", function()
52 before_each(function() 38 before_each(test_mock_server.init)
53 assert.is_true(test_env.need_rock("restserver-xavante"))
54 local final_command = test_env.execute_helper(testing_paths.lua .. " " .. testing_paths.testing_dir .. "/mock-server.lua &", true, test_env.env_variables)
55 os.execute(final_command)
56 end)
57 39
58 after_each(function() 40 after_each(test_mock_server.done)
59 os.execute("curl localhost:8080/shutdown")
60 end)
61 41
62 it("LuaRocks upload rockspec with api-key", function() 42 it("LuaRocks upload rockspec with api-key", function()
63 assert.is_true(run.luarocks_bool("upload " .. testing_paths.testing_dir .. "/testfiles/a_rock-1.0-1.rockspec " .. test_env.OPENSSL_DIRS .. " --api-key=123", {LUAROCKS_CONFIG = testing_paths.testing_dir .. "/luarocks_site.lua"})) 43 assert.is_true(run.luarocks_bool("upload " .. testing_paths.testing_dir .. "/testfiles/a_rock-1.0-1.rockspec " .. test_env.OPENSSL_DIRS .. " --api-key=123", {LUAROCKS_CONFIG = testing_paths.testing_dir .. "/luarocks_site.lua"}))
@@ -68,4 +48,3 @@ describe("LuaRocks upload tests #blackbox #b_upload", function()
68 end) 48 end)
69end) 49end)
70 50
71