From 97bee65c4a8575f3756d85d6db9748a390ee864b Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Fri, 30 Mar 2018 15:23:19 -0300 Subject: Tests: bump version of abelhas in tests TODO: this should be changed to depend on local files only. --- spec/new_version_spec.lua | 30 +++++++++++++++++------------- spec/remove_spec.lua | 10 +++++----- 2 files changed, 22 insertions(+), 18 deletions(-) (limited to 'spec') 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() end) it("with invalid url", function() - assert.is_true(run.luarocks_bool("download --rockspec abelhas 1.0")) - assert.is_true(run.luarocks_bool("new_version abelhas-1.0-1.rockspec 1.1 http://luainvalid")) + assert.is_true(run.luarocks_bool("download --rockspec abelhas 1.1")) + assert.is_true(run.luarocks_bool("new_version abelhas-1.1-1.rockspec 1.1 http://luainvalid")) assert.is.truthy(lfs.attributes("abelhas-1.1-1.rockspec")) - test_env.remove_files(lfs.currentdir(), "abelhas--") + test_env.remove_files(lfs.currentdir(), "abelhas%-") end) end) @@ -44,38 +44,42 @@ describe("LuaRocks new_version tests #blackbox #b_new_version", function() assert.is_true(run.luarocks_bool("download --rockspec luacov 0.11.0")) assert.is_true(run.luarocks_bool("new_version luacov-0.11.0-1.rockspec 0.2")) assert.is.truthy(lfs.attributes("luacov-0.2-1.rockspec")) - test_env.remove_files(lfs.currentdir(), "luacov--") + test_env.remove_files(lfs.currentdir(), "luacov%-") end) it("url of abelhas", function() - assert.is_true(run.luarocks_bool("download --rockspec abelhas 1.0")) - 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")) - assert.is.truthy(lfs.attributes("abelhas-1.1-1.rockspec")) - test_env.remove_files(lfs.currentdir(), "abelhas--") + assert.is_true(run.luarocks_bool("download --rockspec abelhas 1.1")) + assert.is_true(run.luarocks_bool("new_version abelhas-1.1-1.rockspec 1.2 http://example.com/abelhas-1.2.tar.gz")) + assert.is.truthy(lfs.attributes("abelhas-1.2-1.rockspec")) + test_env.remove_files(lfs.currentdir(), "abelhas%-") end) it("of luacov with tag", function() assert.is_true(run.luarocks_bool("download --rockspec luacov 0.11.0")) assert.is_true(run.luarocks_bool("new_version luacov-0.11.0-1.rockspec --tag v0.3")) assert.is.truthy(lfs.attributes("luacov-0.3-1.rockspec")) - test_env.remove_files(lfs.currentdir(), "luacov--") + test_env.remove_files(lfs.currentdir(), "luacov%-") end) it("updating md5", function() assert.is_true(run.luarocks_bool("download --rockspec lpeg 0.12")) 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")) - test_env.remove_files(lfs.currentdir(), "lpeg--") + test_env.remove_files(lfs.currentdir(), "lpeg%-") end) end) describe("remote tests #mock", function() - it("with remote spec", function() + setup(function() test_env.mock_server_init() + end) + teardown(function() + test_env.mock_server_done() + end) + it("with remote spec", function() assert.is_true(run.luarocks_bool("new_version http://localhost:8080/file/a_rock-1.0-1.rockspec")) assert.is.truthy(lfs.attributes("a_rock-1.0-1.rockspec")) assert.is.truthy(lfs.attributes("a_rock-1.0-2.rockspec")) - test_env.remove_files(lfs.currentdir(), "luasocket--") - test_env.mock_server_done() + test_env.remove_files(lfs.currentdir(), "luasocket%-") end) end) 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 test_env.unload_luarocks() local extra_rocks = { - "/abelhas-1.0-1.rockspec", + "/abelhas-1.1-1.rockspec", "/lualogging-1.3.0-1.src.rock", "/luasocket-3.0rc1-2.src.rock", "/luasocket-3.0rc1-2.rockspec" @@ -36,16 +36,16 @@ describe("LuaRocks remove tests #blackbox #b_remove", function() end) it("LuaRocks remove built abelhas", function() - assert.is_true(run.luarocks_bool("build abelhas 1.0")) + assert.is_true(run.luarocks_bool("build abelhas 1.1")) assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/abelhas")) - assert.is_true(run.luarocks_bool("remove abelhas 1.0")) + assert.is_true(run.luarocks_bool("remove abelhas 1.1")) assert.is.falsy(lfs.attributes(testing_paths.testing_sys_rocks .. "/abelhas")) end) it("LuaRocks remove built abelhas with uppercase name", function() - assert.is_true(run.luarocks_bool("build abelhas 1.0")) + assert.is_true(run.luarocks_bool("build abelhas 1.1")) assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/abelhas")) - assert.is_true(run.luarocks_bool("remove Abelhas 1.0")) + assert.is_true(run.luarocks_bool("remove Abelhas 1.1")) assert.is.falsy(lfs.attributes(testing_paths.testing_sys_rocks .. "/abelhas")) end) end) -- cgit v1.2.3-55-g6feb