From bd27d052eaf856bf24c77f556a50b7e19f11cba1 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Fri, 14 Feb 2020 09:53:12 -0300 Subject: tests: shorter descriptions --- spec/add_spec.lua | 12 ++++++------ spec/deps_spec.lua | 16 ++++++++-------- spec/dir_spec.lua | 2 +- spec/doc_spec.lua | 22 +++++++++++----------- spec/download_spec.lua | 10 +++++----- spec/external_spec.lua | 2 +- spec/fetch_spec.lua | 2 +- spec/fs_spec.lua | 2 +- spec/fun_spec.lua | 2 +- spec/help_spec.lua | 10 +++++----- spec/init_spec.lua | 12 ++++++------ spec/lint_spec.lua | 18 +++++++++--------- spec/list_spec.lua | 10 +++++----- spec/make_manifest_spec.lua | 8 +++----- spec/make_spec.lua | 22 +++++++++++----------- spec/new_version_spec.lua | 2 +- spec/pack_spec.lua | 2 +- spec/path_spec.lua | 20 ++++++++++---------- spec/persist_spec.lua | 2 +- spec/purge_spec.lua | 38 ++++++++++++++++++-------------------- spec/refresh_cache_spec.lua | 8 +++----- spec/remove_spec.lua | 24 ++++++++++++------------ spec/search_spec.lua | 12 ++++++------ spec/show_spec.lua | 2 +- spec/unpack_spec.lua | 22 +++++++++++----------- spec/upload_spec.lua | 16 ++++++++-------- spec/util_spec.lua | 16 ++++++++-------- spec/which_spec.lua | 2 +- spec/write_rockspec_spec.lua | 2 +- 29 files changed, 156 insertions(+), 162 deletions(-) diff --git a/spec/add_spec.lua b/spec/add_spec.lua index 394b8f8a..b0b3a171 100644 --- a/spec/add_spec.lua +++ b/spec/add_spec.lua @@ -16,28 +16,28 @@ describe("LuaRocks add tests #integration", function() end) describe("LuaRocks-admin add tests", function() - it("LuaRocks-admin add invalid rock #ssh", function() + it("invalid rock #ssh", function() assert.is_false(run.luarocks_admin_bool("--server=testing add invalid")) end) - it("LuaRocks-admin add missing argument", function() + it("missing argument", function() assert.is_false(run.luarocks_admin_bool("--server=testing add")) end) - it("LuaRocks-admin add invalid server", function() + it("invalid server", function() assert.is_false(run.luarocks_admin_bool("--server=invalid add " .. testing_paths.testing_server .. "/luasocket-3.0rc1-2.src.rock")) end) - it("LuaRocks-admin add invalid server #ssh", function() + it("invalid server #ssh", function() assert.is_true(run.luarocks_admin_bool("--server=testing add " .. testing_paths.testing_server .. "/luasocket-3.0rc1-2.src.rock")) end) --TODO This test fails, sftp support not yet implemented - it("LuaRocks-admin add invalid server", function() + it("invalid server", function() assert.is_false(run.luarocks_admin_bool("--server=testing add luasocket-3.0rc1-2.src.rock", { LUAROCKS_CONFIG = testing_paths.testrun_dir .. "/testing_config_sftp.lua" } )) end) - it("LuaRocks-admin add, split server url", function() + it("split server url", function() assert.is_false(run.luarocks_admin_bool("--server=\"localhost@/tmp/luarocks_testing\" add " .. testing_paths.testing_server .. "/luasocket-3.0rc1-2.src.rock")) end) end) diff --git a/spec/deps_spec.lua b/spec/deps_spec.lua index 846434f4..b677acc4 100644 --- a/spec/deps_spec.lua +++ b/spec/deps_spec.lua @@ -13,13 +13,13 @@ local extra_rocks = { "/lpeg-1.0.0-1.src.rock", } -describe("LuaRocks deps tests #integration", function() +describe("LuaRocks deps-mode #integration", function() before_each(function() test_env.setup_specs(extra_rocks) end) - it("LuaRocks deps mode one", function() + it("one", function() assert.is_true(run.luarocks_bool("build --tree=system lpeg")) assert.is_true(run.luarocks_bool("build --deps-mode=one --tree=" .. testing_paths.testing_tree .. " lxsh")) @@ -29,7 +29,7 @@ describe("LuaRocks deps tests #integration", function() assert.is.falsy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lxsh/0.8.6-2/lxsh-0.8.6-2.rockspec")) end) - it("LuaRocks deps mode order", function() + it("order", function() assert.is_true(run.luarocks_bool("build --tree=system lpeg")) assert.is_true(run.luarocks_bool("build --deps-mode=order --tree=" .. testing_paths.testing_tree .. " lxsh")) @@ -39,7 +39,7 @@ describe("LuaRocks deps tests #integration", function() assert.is.falsy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lxsh/0.8.6-2/lxsh-0.8.6-2.rockspec")) end) - it("LuaRocks deps mode order sys", function() + it("order sys", function() assert.is_true(run.luarocks_bool("build --tree=" .. testing_paths.testing_tree .. " lpeg")) assert.is_true(run.luarocks_bool("build --deps-mode=order --tree=" .. testing_paths.testing_sys_tree .. " lxsh")) @@ -49,7 +49,7 @@ describe("LuaRocks deps tests #integration", function() assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lxsh/0.8.6-2/lxsh-0.8.6-2.rockspec")) end) - it("LuaRocks deps mode all sys", function() + it("all sys", function() assert.is_true(run.luarocks_bool("build --tree=" .. testing_paths.testing_tree .. " lpeg")) assert.is_true(run.luarocks_bool("build --deps-mode=all --tree=" .. testing_paths.testing_sys_tree .. " lxsh")) @@ -59,7 +59,7 @@ describe("LuaRocks deps tests #integration", function() assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lxsh/0.8.6-2/lxsh-0.8.6-2.rockspec")) end) - it("LuaRocks deps mode none", function() + it("none", function() assert.is_true(run.luarocks_bool("build --tree=" .. testing_paths.testing_tree .. " lpeg")) assert.is_true(run.luarocks_bool("build --deps-mode=none lxsh")) @@ -78,7 +78,7 @@ describe("LuaRocks deps tests #integration", function() assert.is.falsy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lxsh/0.8.6-2/lxsh-0.8.6-2.rockspec")) end) - it("LuaRocks deps mode make order", function() + it("make order", function() assert.is_true(run.luarocks_bool("build --tree=" .. testing_paths.testing_sys_tree .. " lpeg")) assert.is_true(run.luarocks_bool("download --source lxsh 0.8.6")) assert.is_true(run.luarocks_bool("unpack lxsh-0.8.6-2.src.rock")) @@ -95,7 +95,7 @@ describe("LuaRocks deps tests #integration", function() assert.is.falsy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lxsh/0.8.6-2/lxsh-0.8.6-2.rockspec")) end) - it("LuaRocks deps mode make order sys", function() + it("make order sys", function() assert.is_true(run.luarocks_bool("build --tree=" .. testing_paths.testing_tree .. " lpeg")) assert.is_true(run.luarocks_bool("download --source lxsh 0.8.6")) assert.is_true(run.luarocks_bool("unpack lxsh-0.8.6-2.src.rock")) diff --git a/spec/dir_spec.lua b/spec/dir_spec.lua index 249f8aba..c5162b60 100644 --- a/spec/dir_spec.lua +++ b/spec/dir_spec.lua @@ -5,7 +5,7 @@ test_env.unload_luarocks() test_env.setup_specs() local dir = require("luarocks.dir") -describe("Luarocks dir test #unit", function() +describe("luarocks.dir #unit", function() local runner setup(function() diff --git a/spec/doc_spec.lua b/spec/doc_spec.lua index 2c0f4bce..19cfb26a 100644 --- a/spec/doc_spec.lua +++ b/spec/doc_spec.lua @@ -4,21 +4,21 @@ local testing_paths = test_env.testing_paths test_env.unload_luarocks() -describe("LuaRocks doc tests #integration", function() +describe("luarocks doc #integration", function() before_each(function() test_env.setup_specs(extra_rocks) end) - describe("LuaRocks doc basic tests", function() - it("LuaRocks doc with no flags/arguments", function() + describe("basic tests", function() + it("with no flags/arguments", function() assert.is_false(run.luarocks_bool("doc")) end) - it("LuaRocks doc with invalid argument", function() + it("with invalid argument", function() assert.is_false(run.luarocks_bool("doc invalid")) end) - it("LuaRocks doc with no homepage and no doc folder", function() + it("with no homepage and no doc folder", function() test_env.run_in_tmp(function(tmpdir) test_env.write_file("test-1.0-1.rockspec", [[ package = "test" @@ -40,7 +40,7 @@ describe("LuaRocks doc tests #integration", function() end, finally) end) - it("LuaRocks doc with no doc folder but with homepage", function() + it("with no doc folder but with homepage", function() test_env.run_in_tmp(function(tmpdir) test_env.write_file("test-1.0-1.rockspec", [[ package = "test" @@ -75,8 +75,8 @@ describe("LuaRocks doc tests #integration", function() end) end) - describe("LuaRocks doc tests with flags", function() - it("LuaRocks doc of installed package", function() + describe("tests with flags", function() + it("of installed package", function() test_env.run_in_tmp(function(tmpdir) test_env.write_file("test-1.0-1.rockspec", [[ package = "test" @@ -101,7 +101,7 @@ describe("LuaRocks doc tests #integration", function() end, finally) end) - it("LuaRocks doc with --list", function() + it("with --list", function() test_env.run_in_tmp(function(tmpdir) test_env.write_file("test-1.0-1.rockspec", [[ package = "test" @@ -128,12 +128,12 @@ describe("LuaRocks doc tests #integration", function() end, finally) end) - it("LuaRocks doc with --local", function() + it("with --local", function() assert.is_true(run.luarocks_bool("install --server=" .. testing_paths.fixtures_dir .. "/a_repo a_rock")) assert.is_true(run.luarocks_bool("doc --server=" .. testing_paths.fixtures_dir .. "/a_repo a_rock --local")) end) - it("LuaRocks doc with --porcelain", function() + it("with --porcelain", function() test_env.run_in_tmp(function(tmpdir) test_env.write_file("test-1.0-1.rockspec", [[ package = "test" diff --git a/spec/download_spec.lua b/spec/download_spec.lua index 39f5b056..42f72008 100644 --- a/spec/download_spec.lua +++ b/spec/download_spec.lua @@ -9,27 +9,27 @@ local extra_rocks = { "/validate-args-1.5.4-1.rockspec" } -describe("LuaRocks download tests #integration", function() +describe("luarocks download #integration", function() before_each(function() test_env.setup_specs(extra_rocks) end) - it("LuaRocks download with no flags/arguments", function() + it("with no flags/arguments", function() assert.is_false(run.luarocks_bool("download")) end) - it("LuaRocks download invalid", function() + it("invalid", function() assert.is_false(run.luarocks_bool("download invalid")) end) - it("LuaRocks download all with delete downloaded files", function() --TODO maybe download --all more rocks + it("all with delete downloaded files", function() --TODO maybe download --all more rocks assert.is_true(run.luarocks_bool("download --all validate-args")) assert.is.truthy(lfs.attributes("validate-args-1.5.4-1.rockspec")) test_env.remove_files(lfs.currentdir(), "validate--args--") end) - it("LuaRocks download rockspec version", function() + it("rockspec version", function() assert.is_true(run.luarocks_bool("download --rockspec validate-args 1.5.4-1")) assert.is.truthy(lfs.attributes("validate-args-1.5.4-1.rockspec")) test_env.remove_files(lfs.currentdir(), "validate--args--") diff --git a/spec/external_spec.lua b/spec/external_spec.lua index 4f1b8dce..63363b76 100644 --- a/spec/external_spec.lua +++ b/spec/external_spec.lua @@ -4,7 +4,7 @@ local testing_paths = test_env.testing_paths test_env.setup_specs() -describe("LuaRocks external commands #integration", function() +describe("luarocks external commands #integration", function() setup(function() test_env.mock_server_init() end) diff --git a/spec/fetch_spec.lua b/spec/fetch_spec.lua index cca4fbc7..6e23a8f2 100644 --- a/spec/fetch_spec.lua +++ b/spec/fetch_spec.lua @@ -13,7 +13,7 @@ local get_tmp_path = test_env.get_tmp_path local testing_paths = test_env.testing_paths local write_file = test_env.write_file -describe("Luarocks fetch test #unit #mock", function() +describe("luarocks fetch #unit #mock", function() local are_same_files = function(file1, file2) return file1 == file2 or lfs.attributes(file1).ino == lfs.attributes(file2).ino end diff --git a/spec/fs_spec.lua b/spec/fs_spec.lua index 16295869..cc36d277 100644 --- a/spec/fs_spec.lua +++ b/spec/fs_spec.lua @@ -19,7 +19,7 @@ local function chdir(d) fs.change_dir(d) end -describe("Luarocks fs test #unit", function() +describe("luarocks.fs #unit", function() local exists_file = function(path) local ok, err, code = os.rename(path, path) if not ok and code == 13 then diff --git a/spec/fun_spec.lua b/spec/fun_spec.lua index 064440e0..b3589c12 100644 --- a/spec/fun_spec.lua +++ b/spec/fun_spec.lua @@ -4,7 +4,7 @@ local testing_paths = test_env.testing_paths test_env.unload_luarocks() local fun = require("luarocks.fun") -describe("LuaRocks fun tests #unit", function() +describe("luarocks.fun #unit", function() local runner setup(function() diff --git a/spec/help_spec.lua b/spec/help_spec.lua index 93b89ce7..70dc5a7e 100644 --- a/spec/help_spec.lua +++ b/spec/help_spec.lua @@ -3,25 +3,25 @@ local run = test_env.run test_env.unload_luarocks() -describe("LuaRocks help tests #integration", function() +describe("luarocks help #integration", function() before_each(function() test_env.setup_specs() end) - it("LuaRocks help with no flags/arguments", function() + it("with no flags/arguments", function() assert.is_true(run.luarocks_bool("help")) end) - it("LuaRocks help invalid argument", function() + it("invalid argument", function() assert.is_false(run.luarocks_bool("help invalid")) end) - it("LuaRocks help config", function() + it("config", function() assert.is_true(run.luarocks_bool("help config")) end) - it("LuaRocks-admin help with no flags/arguments", function() + it("luarocks-admin help with no flags/arguments", function() assert.is_true(run.luarocks_admin_bool(test_env.quiet("help"))) end) end) diff --git a/spec/init_spec.lua b/spec/init_spec.lua index d8a8e899..4a9c9ab7 100644 --- a/spec/init_spec.lua +++ b/spec/init_spec.lua @@ -8,13 +8,13 @@ local lfs = require("lfs") test_env.unload_luarocks() -describe("Luarocks init test #integration", function() +describe("luarocks init #integration", function() setup(function() test_env.setup_specs() end) - it("LuaRocks init with no arguments", function() + it("with no arguments", function() test_env.run_in_tmp(function(tmpdir) local myproject = tmpdir .. "/myproject" lfs.mkdir(myproject) @@ -75,7 +75,7 @@ describe("Luarocks init test #integration", function() end, finally) end) - it("LuaRocks init with given arguments", function() + it("with given arguments", function() test_env.run_in_tmp(function(tmpdir) local myproject = tmpdir .. "/myproject" lfs.mkdir(myproject) @@ -86,7 +86,7 @@ describe("Luarocks init test #integration", function() end, finally) end) - it("LuaRocks init with --lua-versions", function() + it("with --lua-versions", function() test_env.run_in_tmp(function(tmpdir) local myproject = tmpdir .. "/myproject" lfs.mkdir(myproject) @@ -102,7 +102,7 @@ describe("Luarocks init test #integration", function() end, finally) end) - it("LuaRocks init in a git repo", function() + it("in a git repo", function() test_env.run_in_tmp(function(tmpdir) local myproject = tmpdir .. "/myproject" copy_dir(testing_paths.fixtures_dir .. "/git_repo", myproject) @@ -123,7 +123,7 @@ describe("Luarocks init test #integration", function() end, finally) end) - it("LuaRocks init does not autodetect config or dependencies as modules of the package", function() + it("does not autodetect config or dependencies as modules of the package", function() test_env.run_in_tmp(function(tmpdir) local myproject = tmpdir .. "/myproject" lfs.mkdir(myproject) diff --git a/spec/lint_spec.lua b/spec/lint_spec.lua index 4bc93e95..75774061 100644 --- a/spec/lint_spec.lua +++ b/spec/lint_spec.lua @@ -11,28 +11,28 @@ local extra_rocks = { "/validate-args-1.5.4-1.rockspec" } -describe("LuaRocks lint tests #integration", function() +describe("luarocks lint #integration", function() before_each(function() test_env.setup_specs(extra_rocks) end) - it("LuaRocks lint with no flags/arguments", function() + it("with no flags/arguments", function() assert.is_false(run.luarocks_bool("lint")) end) - it("LuaRocks lint invalid argument", function() + it("invalid argument", function() assert.is_false(run.luarocks_bool("lint invalid")) end) - it("LuaRocks lint OK", function() + it("OK", function() assert.is_true(run.luarocks_bool("download --rockspec validate-args 1.5.4-1")) local output = run.luarocks("lint validate-args-1.5.4-1.rockspec") assert.are.same(output, "") assert.is_true(os.remove("validate-args-1.5.4-1.rockspec")) end) - describe("LuaRocks lint mismatch set", function() + describe("mismatch set", function() local tmpdir local olddir @@ -52,7 +52,7 @@ describe("LuaRocks lint tests #integration", function() end end) - it("LuaRocks lint mismatch string", function() + it("mismatch string", function() write_file("type_mismatch_string-1.0-1.rockspec", [[ package="type_mismatch_version" version=1.0 @@ -60,7 +60,7 @@ describe("LuaRocks lint tests #integration", function() assert.is_false(run.luarocks_bool("lint type_mismatch_string-1.0-1.rockspec")) end) - it("LuaRocks lint mismatch version", function() + it("mismatch version", function() write_file("type_mismatch_version-1.0-1.rockspec", [[ package="type_mismatch_version" version="1.0" @@ -68,7 +68,7 @@ describe("LuaRocks lint tests #integration", function() assert.is_false(run.luarocks_bool("lint type_mismatch_version-1.0-1.rockspec")) end) - it("LuaRocks lint mismatch table", function() + it("mismatch table", function() write_file("type_mismatch_table-1.0-1.rockspec", [[ package="type_mismatch_table" version="1.0-1" @@ -78,7 +78,7 @@ describe("LuaRocks lint tests #integration", function() assert.is_false(run.luarocks_bool("lint type_mismatch_table-1.0-1.rockspec")) end) - it("LuaRocks lint mismatch no build table", function() + it("mismatch no build table", function() write_file("no_build_table-1.0-1.rockspec", [[ package = "no_build_table" version = "0.1-1" diff --git a/spec/list_spec.lua b/spec/list_spec.lua index 8e05c064..20af7164 100644 --- a/spec/list_spec.lua +++ b/spec/list_spec.lua @@ -9,23 +9,23 @@ local extra_rocks = { "/say-1.2-1.src.rock" } -describe("LuaRocks list tests #integration", function() +describe("luarocks list #integration", function() before_each(function() test_env.setup_specs(extra_rocks) end) - it("LuaRocks list with no flags/arguments", function() + it("with no flags/arguments", function() local output = run.luarocks("list") assert.match("luacov", output) end) - it("LuaRocks list porcelain", function() + it("--porcelain", function() local output = run.luarocks("list --porcelain") assert.is.truthy(output:find("luacov\t0.13.0-1\tinstalled\t" .. testing_paths.testing_sys_rocks, 1, true)) end) - it("LuaRocks list shows version number", function() + it("shows version number", function() local output = run.luarocks("list") assert.is.truthy(output:find("luacov")) assert.matches("0.13.0-1", output, 1, true) @@ -38,7 +38,7 @@ describe("LuaRocks list tests #integration", function() assert.matches("1.0-1 < ", output, 1, true) end) - it("LuaRocks list invalid tree", function() + it("invalid tree", function() local output = run.luarocks("--tree=/some/invalid/tree list") assert(output:find("Rocks installed for Lua "..test_env.lua_version.." in /some/invalid/tree", 1, true)) end) diff --git a/spec/make_manifest_spec.lua b/spec/make_manifest_spec.lua index a33b1f5b..a3d015c9 100644 --- a/spec/make_manifest_spec.lua +++ b/spec/make_manifest_spec.lua @@ -3,15 +3,13 @@ local run = test_env.run test_env.unload_luarocks() -describe("LuaRocks make_manifest tests #integration", function() +describe("luarocks make_manifest #integration", function() before_each(function() test_env.setup_specs() end) - describe("LuaRocks-admin make manifest tests", function() - it("LuaRocks-admin make manifest", function() - assert.is_true(run.luarocks_admin_bool("make_manifest")) - end) + it("runs", function() + assert.is_true(run.luarocks_admin_bool("make_manifest")) end) end) diff --git a/spec/make_spec.lua b/spec/make_spec.lua index 8baa3561..1bfbce7e 100644 --- a/spec/make_spec.lua +++ b/spec/make_spec.lua @@ -15,13 +15,13 @@ local extra_rocks = { "/lxsh-0.8.6-2.rockspec" } -describe("LuaRocks make tests #integration", function() +describe("luarocks make #integration", function() before_each(function() test_env.setup_specs(extra_rocks) end) - it("LuaRocks make with no flags/arguments", function() + it("with no flags/arguments", function() finally(function() lfs.chdir(testing_paths.testrun_dir) test_env.remove_dir("empty") @@ -31,7 +31,7 @@ describe("LuaRocks make tests #integration", function() assert.is_false(run.luarocks_bool("make")) end) - it("LuaRocks make with rockspec", function() + it("with rockspec", function() finally(function() -- delete downloaded and unpacked files lfs.chdir(testing_paths.testrun_dir) @@ -50,7 +50,7 @@ describe("LuaRocks make tests #integration", function() assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/luasocket/3.0rc1-2/luasocket-3.0rc1-2.rockspec")) end) - it("LuaRocks make --no-doc", function() + it("--no-doc", function() finally(function() lfs.chdir(testing_paths.testrun_dir) test_env.remove_dir("luasocket-3.0rc1-2") @@ -81,7 +81,7 @@ describe("LuaRocks make tests #integration", function() assert.is_true(os.remove("lxsh-0.8.6-2.src.rock")) end) - it("LuaRocks make default rockspec", function() + it("default rockspec", function() assert.is_true(run.luarocks_bool("new_version lxsh-0.8.6-2.rockspec")) assert.is_true(run.luarocks_bool("make")) @@ -89,7 +89,7 @@ describe("LuaRocks make tests #integration", function() assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lxsh/0.8.6-3/lxsh-0.8.6-3.rockspec")) end) - it("LuaRocks make unnamed rockspec", function() + it("unnamed rockspec", function() finally(function() os.remove("rockspec") end) @@ -101,7 +101,7 @@ describe("LuaRocks make tests #integration", function() assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lxsh/0.8.6-2/lxsh-0.8.6-2.rockspec")) end) - it("LuaRocks make ambiguous rockspec", function() + it("ambiguous rockspec", function() assert.is.truthy(os.rename("lxsh-0.8.6-2.rockspec", "lxsh2-0.8.6-2.rockspec")) local output = run.luarocks("make") assert.is.truthy(output:match("Error: Inconsistency between rockspec filename")) @@ -110,7 +110,7 @@ describe("LuaRocks make tests #integration", function() assert.is.falsy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lxsh/0.8.6-2/lxsh-0.8.6-2.rockspec")) end) - it("LuaRocks make ambiguous unnamed rockspec", function() + it("ambiguous unnamed rockspec", function() assert.is.truthy(os.rename("lxsh-0.8.6-2.rockspec", "1_rockspec")) test_env.copy("1_rockspec", "2_rockspec") local output = run.luarocks("make") @@ -120,7 +120,7 @@ describe("LuaRocks make tests #integration", function() assert.is.falsy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lxsh/0.8.6-2/lxsh-0.8.6-2.rockspec")) end) - it("LuaRocks make pack binary rock", function() + it("pack binary rock", function() assert.is_true(run.luarocks_bool("make --deps-mode=none --pack-binary-rock")) assert.is.truthy(lfs.attributes("lxsh-0.8.6-2.all.rock")) end) @@ -244,7 +244,7 @@ describe("LuaRocks make tests #integration", function() end) end) - describe("#ddt LuaRocks make upgrading rockspecs with double deploy types", function() + describe("#ddt upgrading rockspecs with double deploy types", function() local deploy_lib_dir = testing_paths.testing_sys_tree .. "/lib/lua/"..env_variables.LUA_VERSION local deploy_lua_dir = testing_paths.testing_sys_tree .. "/share/lua/"..env_variables.LUA_VERSION local so = test_env.lib_extension @@ -347,7 +347,7 @@ describe("LuaRocks make tests #integration", function() end) end) - describe("LuaRocks make upgrading rockspecs with mixed deploy types", function() + describe("upgrading rockspecs with mixed deploy types", function() before_each(function() test_env.copy_dir(testing_paths.fixtures_dir .. "/mixed_deploy_type", "mdt") end) diff --git a/spec/new_version_spec.lua b/spec/new_version_spec.lua index e8952f75..2f628242 100644 --- a/spec/new_version_spec.lua +++ b/spec/new_version_spec.lua @@ -10,7 +10,7 @@ local extra_rocks = { "/lpeg-0.12-1.rockspec" } -describe("LuaRocks new_version tests #integration", function() +describe("luarocks new_version #integration", function() setup(function() test_env.setup_specs(extra_rocks) diff --git a/spec/pack_spec.lua b/spec/pack_spec.lua index f0c128a3..a0b302a3 100644 --- a/spec/pack_spec.lua +++ b/spec/pack_spec.lua @@ -13,7 +13,7 @@ local extra_rocks = { "/say-1.0-1.src.rock" } -describe("LuaRocks pack #integration", function() +describe("luarocks pack #integration", function() before_each(function() test_env.setup_specs(extra_rocks) diff --git a/spec/path_spec.lua b/spec/path_spec.lua index 3a7dcea2..7736741c 100644 --- a/spec/path_spec.lua +++ b/spec/path_spec.lua @@ -3,12 +3,12 @@ local run = test_env.run test_env.unload_luarocks() -describe("LuaRocks path tests #integration", function() +describe("luarocks path #integration", function() before_each(function() test_env.setup_specs() end) - it("LuaRocks path", function() + it("runs", function() local output = run.luarocks("path") assert.match("LUA_PATH=", output) assert.match("LUA_CPATH=", output) @@ -17,21 +17,21 @@ describe("LuaRocks path tests #integration", function() if _VERSION:match("[23]") then local v = _VERSION:gsub("Lua (%d+)%.(%d+)", "%1_%2") - it("LuaRocks path with LUA_PATH_"..v, function() + it("with LUA_PATH_"..v, function() local output = run.luarocks("path", { ["LUA_PATH_"..v] = package.path, }) assert.match("LUA_PATH_"..v.."=", output) end) - it("LuaRocks path with LUA_CPATH_"..v, function() + it("with LUA_CPATH_"..v, function() local output = run.luarocks("path", { ["LUA_CPATH_"..v] = package.cpath, }) assert.match("LUA_CPATH_"..v.."=", output) end) - it("LuaRocks path with LUA_PATH_"..v.." and LUA_CPATH_"..v, function() + it("with LUA_PATH_"..v.." and LUA_CPATH_"..v, function() local output = run.luarocks("path", { ["LUA_PATH_"..v] = package.path, ["LUA_CPATH_"..v] = package.cpath, @@ -42,23 +42,23 @@ describe("LuaRocks path tests #integration", function() end - it("LuaRocks path bin", function() + it("--bin", function() assert.is_true(run.luarocks_bool("path --bin")) end) - it("LuaRocks path lr-path", function() + it("--lr-path", function() assert.is_true(run.luarocks_bool("path --lr-path")) end) - it("LuaRocks path lr-cpath", function() + it("--lr-cpath", function() assert.is_true(run.luarocks_bool("path --lr-cpath")) end) - it("LuaRocks path with tree", function() + it("--tree", function() assert.is_true(run.luarocks_bool("path --tree=lua_modules")) end) - it("LuaRocks path with project-tree", function() + it("--project-tree", function() local path1 = "/share/lua/5%." .. test_env.lua_version:sub(3, 3) .. "/%?%.lua" local path2 = "/share/lua/5%." .. test_env.lua_version:sub(3, 3) .. "/%?/init%.lua" diff --git a/spec/persist_spec.lua b/spec/persist_spec.lua index 734b2a4e..722331b8 100644 --- a/spec/persist_spec.lua +++ b/spec/persist_spec.lua @@ -4,7 +4,7 @@ local testing_paths = test_env.testing_paths test_env.unload_luarocks() local persist = require("luarocks.persist") -describe("Luarocks persist test #unit", function() +describe("luarocks.persist #unit", function() local runner setup(function() diff --git a/spec/purge_spec.lua b/spec/purge_spec.lua index 18445b60..ccd26bdf 100644 --- a/spec/purge_spec.lua +++ b/spec/purge_spec.lua @@ -8,29 +8,27 @@ local extra_rocks = { "/say-1.0-1.src.rock", } -describe("LuaRocks purge tests #integration", function() +describe("luarocks purge #integration", function() before_each(function() test_env.setup_specs(extra_rocks) end) - describe("LuaRocks purge basic tests", function() - it("LuaRocks purge missing tree", function() - assert.is_false(run.luarocks_bool("purge --tree=" .. testing_paths.testing_tree)) - end) - it("LuaRocks purge tree with no string", function() - assert.is_false(run.luarocks_bool("purge --tree=")) - end) - it("LuaRocks purge tree with no string", function() - assert.is_true(run.luarocks_bool("purge --tree=" .. testing_paths.testing_sys_tree)) - end) - it("LuaRocks purge tree missing files", function() - assert.is_true(run.luarocks_bool("install say 1.0")) - test_env.remove_dir(testing_paths.testing_sys_tree .. "/share/lua/"..test_env.lua_version.."/say") - assert.is_true(run.luarocks_bool("purge --tree=" .. testing_paths.testing_sys_tree)) - assert.is_false(test_env.exists(testing_paths.testing_sys_rocks .. "/say")) - end) - it("LuaRocks purge old versions tree", function() - assert.is_true(run.luarocks_bool("purge --old-versions --tree=" .. testing_paths.testing_sys_tree)) - end) + it("missing tree", function() + assert.is_false(run.luarocks_bool("purge --tree=" .. testing_paths.testing_tree)) + end) + it("tree with no string", function() + assert.is_false(run.luarocks_bool("purge --tree=")) + end) + it("tree with no string", function() + assert.is_true(run.luarocks_bool("purge --tree=" .. testing_paths.testing_sys_tree)) + end) + it("tree missing files", function() + assert.is_true(run.luarocks_bool("install say 1.0")) + test_env.remove_dir(testing_paths.testing_sys_tree .. "/share/lua/"..test_env.lua_version.."/say") + assert.is_true(run.luarocks_bool("purge --tree=" .. testing_paths.testing_sys_tree)) + assert.is_false(test_env.exists(testing_paths.testing_sys_rocks .. "/say")) + end) + it("old versions tree", function() + assert.is_true(run.luarocks_bool("purge --old-versions --tree=" .. testing_paths.testing_sys_tree)) end) end) diff --git a/spec/refresh_cache_spec.lua b/spec/refresh_cache_spec.lua index 9bf0361c..c0877371 100644 --- a/spec/refresh_cache_spec.lua +++ b/spec/refresh_cache_spec.lua @@ -3,15 +3,13 @@ local run = test_env.run test_env.unload_luarocks() -describe("LuaRocks refresh_cache tests #integration", function() +describe("luarocks-admin refresh_cache #integration", function() before_each(function() test_env.setup_specs() end) - describe("LuaRocks-admin refresh cache tests #ssh", function() - it("LuaRocks-admin refresh cache", function() - assert.is_true(run.luarocks_admin_bool("--server=testing refresh_cache")) - end) + it("runs #ssh", function() + assert.is_true(run.luarocks_admin_bool("--server=testing refresh_cache")) end) end) diff --git a/spec/remove_spec.lua b/spec/remove_spec.lua index cc9eb599..cdac5c01 100644 --- a/spec/remove_spec.lua +++ b/spec/remove_spec.lua @@ -12,37 +12,37 @@ local extra_rocks = { "/coxpcall-1.16.0-1.rockspec" } -describe("LuaRocks remove tests #integration", function() +describe("luarocks remove #integration", function() before_each(function() test_env.setup_specs(extra_rocks) end) - describe("LuaRocks remove basic tests", function() - it("LuaRocks remove with no flags/arguments", function() + describe("basic tests", function() + it("with no flags/arguments", function() assert.is_false(run.luarocks_bool("remove")) end) - it("LuaRocks remove invalid rock", function() + it("invalid rock", function() assert.is_false(run.luarocks_bool("remove invalid.rock")) end) - it("LuaRocks remove missing rock", function() + it("missing rock", function() assert.is_false(run.luarocks_bool("remove missing_rock")) end) - it("LuaRocks remove invalid argument", function() + it("invalid argument", function() assert.is_false(run.luarocks_bool("remove luacov --deps-mode")) end) - it("LuaRocks remove built abelhas", function() + it("built abelhas", function() 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.1")) assert.is.falsy(lfs.attributes(testing_paths.testing_sys_rocks .. "/abelhas")) end) - it("LuaRocks remove built abelhas with uppercase name", function() + it("built abelhas with uppercase name", function() 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.1")) @@ -50,12 +50,12 @@ describe("LuaRocks remove tests #integration", function() end) end) - describe("LuaRocks remove more complex tests", function() + describe("more complex tests", function() before_each(function() assert.is.truthy(test_env.need_rock("coxpcall")) end) - it("LuaRocks remove fail, break dependencies", function() + it("fail, break dependencies", function() assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/coxpcall")) assert.is_true(run.luarocks_bool("build copas")) @@ -63,7 +63,7 @@ describe("LuaRocks remove tests #integration", function() assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/coxpcall")) end) - it("LuaRocks remove force", function() + it("force", function() assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/coxpcall")) assert.is_true(run.luarocks_bool("build copas")) @@ -72,7 +72,7 @@ describe("LuaRocks remove tests #integration", function() assert.is.truthy(output:find("Checking stability of dependencies")) end) - it("LuaRocks remove force fast", function() + it("force fast", function() assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/coxpcall")) assert.is_true(run.luarocks_bool("build copas")) diff --git a/spec/search_spec.lua b/spec/search_spec.lua index 90efb552..1b5d79fa 100644 --- a/spec/search_spec.lua +++ b/spec/search_spec.lua @@ -7,29 +7,29 @@ local extra_rocks = { "/lzlib-0.4.1.53-1.src.rock" } -describe("LuaRocks search tests #integration", function() +describe("luarocks search #integration", function() before_each(function() test_env.setup_specs(extra_rocks) end) - it("LuaRocks search with no flags/arguments", function() + it("with no flags/arguments", function() assert.is_false(run.luarocks_bool("search")) end) - it("LuaRocks search zlib", function() + it("zlib", function() assert.is_true(run.luarocks_bool("search zlib")) end) - it("LuaRocks search zlib 1.1", function() + it("zlib 1.1", function() assert.is_true(run.luarocks_bool("search zlib 1.1")) end) - it("LuaRocks search missing rock", function() + it("missing rock", function() assert.is_true(run.luarocks_bool("search missing_rock")) end) - it("LuaRocks search with flag all", function() + it("with flag all", function() assert.is_true(run.luarocks_bool("search --all")) end) end) diff --git a/spec/show_spec.lua b/spec/show_spec.lua index c2840d29..e4937157 100644 --- a/spec/show_spec.lua +++ b/spec/show_spec.lua @@ -4,7 +4,7 @@ local testing_paths = test_env.testing_paths test_env.unload_luarocks() -describe("LuaRocks show #integration", function() +describe("luarocks show #integration", function() before_each(function() test_env.setup_specs() diff --git a/spec/unpack_spec.lua b/spec/unpack_spec.lua index 1eb40f59..489e01e6 100644 --- a/spec/unpack_spec.lua +++ b/spec/unpack_spec.lua @@ -10,40 +10,40 @@ local extra_rocks = { "/luazip-1.2.4-1.rockspec" } -describe("LuaRocks unpack tests #integration", function() +describe("luarocks unpack #integration", function() before_each(function() test_env.setup_specs(extra_rocks) end) - describe("LuaRocks unpack basic fail tests", function() - it("LuaRocks unpack with no flags/arguments", function() + describe("basic fail tests", function() + it("with no flags/arguments", function() assert.is_false(run.luarocks_bool("unpack")) end) - it("LuaRocks unpack with invalid rockspec", function() + it("with invalid rockspec", function() assert.is_false(run.luarocks_bool("unpack invalid.rockspec")) end) - it("LuaRocks unpack with invalid patch", function() + it("with invalid patch", function() assert.is_false(run.luarocks_bool("unpack " .. testing_paths.fixtures_dir .. "/invalid_patch-0.1-1.rockspec")) end) end) - describe("LuaRocks unpack more complex tests", function() - it("LuaRocks unpack download", function() + describe("more complex tests", function() + it("download", function() assert.is_true(run.luarocks_bool("unpack cprint")) test_env.remove_dir("cprint-0.1-2") end) - it("LuaRocks unpack src", function() + it("src", function() assert.is_true(run.luarocks_bool("download --source cprint")) assert.is_true(run.luarocks_bool("unpack cprint-0.1-2.src.rock")) os.remove("cprint-0.1-2.src.rock") test_env.remove_dir("cprint-0.1-2") end) - it("LuaRocks unpack src", function() + it("src", function() assert.is_true(run.luarocks_bool("download --rockspec cprint")) assert.is_true(run.luarocks_bool("unpack cprint-0.1-2.rockspec")) os.remove("cprint-0.1-2.rockspec") @@ -52,14 +52,14 @@ describe("LuaRocks unpack tests #integration", function() end) -- #595 luarocks unpack of a git:// rockspec fails to copy the rockspec - it("LuaRocks unpack git:// rockspec", function() + it("git:// rockspec", function() assert.is_true(run.luarocks_bool("download --rockspec luazip")) assert.is_true(run.luarocks_bool("unpack luazip-1.2.4-1.rockspec")) assert.is_truthy(lfs.attributes("luazip-1.2.4-1/luazip/luazip-1.2.4-1.rockspec")) test_env.remove_dir("luazip-1.2.4-1") end) - it("LuaRocks unpack binary", function() + it("binary", function() assert.is_true(run.luarocks_bool("build cprint")) assert.is_true(run.luarocks_bool("pack cprint")) assert.is_true(run.luarocks_bool("unpack cprint-0.1-2." .. test_env.platform .. ".rock")) diff --git a/spec/upload_spec.lua b/spec/upload_spec.lua index 3f376d0d..dc073c18 100644 --- a/spec/upload_spec.lua +++ b/spec/upload_spec.lua @@ -4,39 +4,39 @@ local testing_paths = test_env.testing_paths test_env.unload_luarocks() -describe("LuaRocks upload tests #integration", function() +describe("luarocks upload #integration", function() before_each(function() test_env.setup_specs() end) - it("LuaRocks upload with no flags/arguments", function() + it("with no flags/arguments", function() assert.is_false(run.luarocks_bool("upload")) end) - it("LuaRocks upload invalid rockspec", function() + it("invalid rockspec", function() assert.is_false(run.luarocks_bool("upload invalid.rockspec")) end) - it("LuaRocks upload api key invalid", function() + it("api key invalid", function() assert.is_false(run.luarocks_bool("upload --api-key=invalid invalid.rockspec")) end) - it("LuaRocks upload api key invalid and skip-pack", function() + it("api key invalid and skip-pack", function() assert.is_false(run.luarocks_bool("upload --api-key=\"invalid\" --skip-pack " .. testing_paths.testing_server .. "/luasocket-3.0rc1-2.rockspec")) end) - it("LuaRocks upload force #unix", function() + it("force #unix", function() assert.is_true(test_env.need_rock("dkjson")) assert.is_false(run.luarocks_bool("upload --api-key=\"invalid\" --force " .. testing_paths.testing_server .. "/luasocket-3.0rc1-2.rockspec")) end) - describe("LuaRocks upload tests with Xavante server #mock", function() + describe("tests with Xavante server #mock", function() before_each(test_env.mock_server_init) after_each(test_env.mock_server_done) - it("LuaRocks upload rockspec with api-key", function() + it("rockspec with api-key", function() assert.is_true(run.luarocks_bool("upload " .. testing_paths.fixtures_dir .. "/a_rock-1.0-1.rockspec " .. test_env.openssl_dirs .. " --api-key=123", {LUAROCKS_CONFIG = testing_paths.testrun_dir .. "/luarocks_site.lua"})) end) diff --git a/spec/util_spec.lua b/spec/util_spec.lua index b1693cfa..3970a57c 100644 --- a/spec/util_spec.lua +++ b/spec/util_spec.lua @@ -9,15 +9,15 @@ describe("Basic tests #integration", function() test_env.setup_specs() end) - it("LuaRocks version", function() + it("--version", function() assert.is_true(run.luarocks_bool("--version")) end) - it("LuaRocks unknown command", function() + it("unknown command", function() assert.is_false(run.luarocks_bool("unknown_command")) end) - it("LuaRocks arguments fail", function() + it("arguments fail", function() assert.is_false(run.luarocks_bool("--porcelain=invalid")) assert.is_false(run.luarocks_bool("--invalid-flag")) assert.is_false(run.luarocks_bool("--server")) @@ -26,7 +26,7 @@ describe("Basic tests #integration", function() assert.is_false(run.luarocks_bool("invalid=5")) end) - it("LuaRocks execute from not existing directory #unix", function() + it("executing from not existing directory #unix", function() local main_path = lfs.currentdir() assert.is_true(lfs.mkdir("idontexist")) assert.is_true(lfs.chdir("idontexist")) @@ -41,15 +41,15 @@ describe("Basic tests #integration", function() assert.is.truthy(output:find("the Lua package manager")) end) - it("LuaRocks timeout", function() + it("--timeout", function() assert.is.truthy(run.luarocks("--timeout=10")) end) - it("LuaRocks timeout invalid", function() + it("--timeout invalid", function() assert.is_false(run.luarocks_bool("--timeout=abc")) end) - it("LuaRocks only server=testing", function() + it("--only-server", function() assert.is.truthy(run.luarocks("--only-server=testing")) end) @@ -59,7 +59,7 @@ test_env.unload_luarocks() local util = require("luarocks.util") local core_util = require("luarocks.core.util") -describe("Luarocks util test #unit", function() +describe("luarocks.util #unit", function() local runner setup(function() diff --git a/spec/which_spec.lua b/spec/which_spec.lua index 79b9ef7e..4e9bdaf4 100644 --- a/spec/which_spec.lua +++ b/spec/which_spec.lua @@ -12,7 +12,7 @@ local extra_rocks = { "/say-1.2-1.src.rock", } -describe("LuaRocks which tests #integration", function() +describe("luarocks which #integration", function() setup(function() test_env.setup_specs(extra_rocks) diff --git a/spec/write_rockspec_spec.lua b/spec/write_rockspec_spec.lua index 35870775..3031cf10 100644 --- a/spec/write_rockspec_spec.lua +++ b/spec/write_rockspec_spec.lua @@ -3,7 +3,7 @@ local git_repo = require("spec.util.git_repo") local lfs = require("lfs") local run = test_env.run -describe("LuaRocks write_rockspec tests #integration", function() +describe("luarocks write_rockspec tests #integration", function() before_each(function() test_env.setup_specs() -- cgit v1.2.3-55-g6feb