aboutsummaryrefslogtreecommitdiff
path: root/spec/new_version_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'spec/new_version_spec.lua')
-rw-r--r--spec/new_version_spec.lua30
1 files changed, 17 insertions, 13 deletions
diff --git a/spec/new_version_spec.lua b/spec/new_version_spec.lua
index 6d9d6860..3d9d5cab 100644
--- a/spec/new_version_spec.lua
+++ b/spec/new_version_spec.lua
@@ -32,10 +32,10 @@ describe("LuaRocks new_version tests #blackbox #b_new_version", function()
32 end) 32 end)
33 33
34 it("with invalid url", function() 34 it("with invalid url", function()
35 assert.is_true(run.luarocks_bool("download --rockspec abelhas 1.0")) 35 assert.is_true(run.luarocks_bool("download --rockspec abelhas 1.1"))
36 assert.is_true(run.luarocks_bool("new_version abelhas-1.0-1.rockspec 1.1 http://luainvalid")) 36 assert.is_true(run.luarocks_bool("new_version abelhas-1.1-1.rockspec 1.1 http://luainvalid"))
37 assert.is.truthy(lfs.attributes("abelhas-1.1-1.rockspec")) 37 assert.is.truthy(lfs.attributes("abelhas-1.1-1.rockspec"))
38 test_env.remove_files(lfs.currentdir(), "abelhas--") 38 test_env.remove_files(lfs.currentdir(), "abelhas%-")
39 end) 39 end)
40 end) 40 end)
41 41
@@ -44,38 +44,42 @@ describe("LuaRocks new_version tests #blackbox #b_new_version", function()
44 assert.is_true(run.luarocks_bool("download --rockspec luacov 0.11.0")) 44 assert.is_true(run.luarocks_bool("download --rockspec luacov 0.11.0"))
45 assert.is_true(run.luarocks_bool("new_version luacov-0.11.0-1.rockspec 0.2")) 45 assert.is_true(run.luarocks_bool("new_version luacov-0.11.0-1.rockspec 0.2"))
46 assert.is.truthy(lfs.attributes("luacov-0.2-1.rockspec")) 46 assert.is.truthy(lfs.attributes("luacov-0.2-1.rockspec"))
47 test_env.remove_files(lfs.currentdir(), "luacov--") 47 test_env.remove_files(lfs.currentdir(), "luacov%-")
48 end) 48 end)
49 49
50 it("url of abelhas", function() 50 it("url of abelhas", function()
51 assert.is_true(run.luarocks_bool("download --rockspec abelhas 1.0")) 51 assert.is_true(run.luarocks_bool("download --rockspec abelhas 1.1"))
52 assert.is_true(run.luarocks_bool("new_version abelhas-1.0-1.rockspec 1.1 http://luaforge.net/frs/download.php/2658/abelhas-1.0.tar.gz")) 52 assert.is_true(run.luarocks_bool("new_version abelhas-1.1-1.rockspec 1.2 http://example.com/abelhas-1.2.tar.gz"))
53 assert.is.truthy(lfs.attributes("abelhas-1.1-1.rockspec")) 53 assert.is.truthy(lfs.attributes("abelhas-1.2-1.rockspec"))
54 test_env.remove_files(lfs.currentdir(), "abelhas--") 54 test_env.remove_files(lfs.currentdir(), "abelhas%-")
55 end) 55 end)
56 56
57 it("of luacov with tag", function() 57 it("of luacov with tag", function()
58 assert.is_true(run.luarocks_bool("download --rockspec luacov 0.11.0")) 58 assert.is_true(run.luarocks_bool("download --rockspec luacov 0.11.0"))
59 assert.is_true(run.luarocks_bool("new_version luacov-0.11.0-1.rockspec --tag v0.3")) 59 assert.is_true(run.luarocks_bool("new_version luacov-0.11.0-1.rockspec --tag v0.3"))
60 assert.is.truthy(lfs.attributes("luacov-0.3-1.rockspec")) 60 assert.is.truthy(lfs.attributes("luacov-0.3-1.rockspec"))
61 test_env.remove_files(lfs.currentdir(), "luacov--") 61 test_env.remove_files(lfs.currentdir(), "luacov%-")
62 end) 62 end)
63 63
64 it("updating md5", function() 64 it("updating md5", function()
65 assert.is_true(run.luarocks_bool("download --rockspec lpeg 0.12")) 65 assert.is_true(run.luarocks_bool("download --rockspec lpeg 0.12"))
66 assert.is_true(run.luarocks_bool("new_version lpeg-0.12-1.rockspec 0.2 https://luarocks.org/manifests/gvvaughan/lpeg-1.0.0-1.rockspec")) 66 assert.is_true(run.luarocks_bool("new_version lpeg-0.12-1.rockspec 0.2 https://luarocks.org/manifests/gvvaughan/lpeg-1.0.0-1.rockspec"))
67 test_env.remove_files(lfs.currentdir(), "lpeg--") 67 test_env.remove_files(lfs.currentdir(), "lpeg%-")
68 end) 68 end)
69 end) 69 end)
70 70
71 describe("remote tests #mock", function() 71 describe("remote tests #mock", function()
72 it("with remote spec", function() 72 setup(function()
73 test_env.mock_server_init() 73 test_env.mock_server_init()
74 end)
75 teardown(function()
76 test_env.mock_server_done()
77 end)
78 it("with remote spec", function()
74 assert.is_true(run.luarocks_bool("new_version http://localhost:8080/file/a_rock-1.0-1.rockspec")) 79 assert.is_true(run.luarocks_bool("new_version http://localhost:8080/file/a_rock-1.0-1.rockspec"))
75 assert.is.truthy(lfs.attributes("a_rock-1.0-1.rockspec")) 80 assert.is.truthy(lfs.attributes("a_rock-1.0-1.rockspec"))
76 assert.is.truthy(lfs.attributes("a_rock-1.0-2.rockspec")) 81 assert.is.truthy(lfs.attributes("a_rock-1.0-2.rockspec"))
77 test_env.remove_files(lfs.currentdir(), "luasocket--") 82 test_env.remove_files(lfs.currentdir(), "luasocket%-")
78 test_env.mock_server_done()
79 end) 83 end)
80 end) 84 end)
81 85