diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2018-03-30 15:23:19 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-03-30 19:52:17 -0300 |
commit | 97bee65c4a8575f3756d85d6db9748a390ee864b (patch) | |
tree | f95fc38fceb09de498e7720c8782a99c5cde3a87 | |
parent | 2dc0a68c941d883753b2d6715921a8952f95204b (diff) | |
download | luarocks-97bee65c4a8575f3756d85d6db9748a390ee864b.tar.gz luarocks-97bee65c4a8575f3756d85d6db9748a390ee864b.tar.bz2 luarocks-97bee65c4a8575f3756d85d6db9748a390ee864b.zip |
Tests: bump version of abelhas in tests
TODO: this should be changed to depend on local files only.
-rw-r--r-- | spec/new_version_spec.lua | 30 | ||||
-rw-r--r-- | spec/remove_spec.lua | 10 |
2 files changed, 22 insertions, 18 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 | ||
diff --git a/spec/remove_spec.lua b/spec/remove_spec.lua index c0e9beb0..9bf038b0 100644 --- a/spec/remove_spec.lua +++ b/spec/remove_spec.lua | |||
@@ -6,7 +6,7 @@ local testing_paths = test_env.testing_paths | |||
6 | test_env.unload_luarocks() | 6 | test_env.unload_luarocks() |
7 | 7 | ||
8 | local extra_rocks = { | 8 | local extra_rocks = { |
9 | "/abelhas-1.0-1.rockspec", | 9 | "/abelhas-1.1-1.rockspec", |
10 | "/lualogging-1.3.0-1.src.rock", | 10 | "/lualogging-1.3.0-1.src.rock", |
11 | "/luasocket-3.0rc1-2.src.rock", | 11 | "/luasocket-3.0rc1-2.src.rock", |
12 | "/luasocket-3.0rc1-2.rockspec" | 12 | "/luasocket-3.0rc1-2.rockspec" |
@@ -36,16 +36,16 @@ describe("LuaRocks remove tests #blackbox #b_remove", function() | |||
36 | end) | 36 | end) |
37 | 37 | ||
38 | it("LuaRocks remove built abelhas", function() | 38 | it("LuaRocks remove built abelhas", function() |
39 | assert.is_true(run.luarocks_bool("build abelhas 1.0")) | 39 | assert.is_true(run.luarocks_bool("build abelhas 1.1")) |
40 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/abelhas")) | 40 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/abelhas")) |
41 | assert.is_true(run.luarocks_bool("remove abelhas 1.0")) | 41 | assert.is_true(run.luarocks_bool("remove abelhas 1.1")) |
42 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_rocks .. "/abelhas")) | 42 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_rocks .. "/abelhas")) |
43 | end) | 43 | end) |
44 | 44 | ||
45 | it("LuaRocks remove built abelhas with uppercase name", function() | 45 | it("LuaRocks remove built abelhas with uppercase name", function() |
46 | assert.is_true(run.luarocks_bool("build abelhas 1.0")) | 46 | assert.is_true(run.luarocks_bool("build abelhas 1.1")) |
47 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/abelhas")) | 47 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/abelhas")) |
48 | assert.is_true(run.luarocks_bool("remove Abelhas 1.0")) | 48 | assert.is_true(run.luarocks_bool("remove Abelhas 1.1")) |
49 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_rocks .. "/abelhas")) | 49 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_rocks .. "/abelhas")) |
50 | end) | 50 | end) |
51 | end) | 51 | end) |