From 2fac17d4d211adf9c1fe9668094febb55ee92389 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Sun, 6 Mar 2022 14:50:49 -0300 Subject: tests: don't use validate-args rockspec in tests We only used the rockspec in testing, but since the app it refers to is GPL-3, it could cause confusion among users, so let's just drop it from the test suite. Closes #1387. --- spec/build_spec.lua | 1 - spec/download_spec.lua | 14 ++++----- spec/fetch_spec.lua | 2 +- spec/fixtures/invalid_say-1.3-1.rockspec | 23 ++++++++++++++ .../invalid_validate-args-1.5.4-1.rockspec | 35 ---------------------- spec/lint_spec.lua | 8 ++--- spec/pack_spec.lua | 2 +- 7 files changed, 36 insertions(+), 49 deletions(-) create mode 100644 spec/fixtures/invalid_say-1.3-1.rockspec delete mode 100644 spec/fixtures/invalid_validate-args-1.5.4-1.rockspec (limited to 'spec') diff --git a/spec/build_spec.lua b/spec/build_spec.lua index b78d3ffb..a970a5da 100644 --- a/spec/build_spec.lua +++ b/spec/build_spec.lua @@ -23,7 +23,6 @@ local extra_rocks = { "/luasocket-3.0rc1-2.src.rock", "/luasocket-3.0rc1-2.rockspec", "/stdlib-41.0.0-1.src.rock", - "/validate-args-1.5.4-1.rockspec", "spec/fixtures/a_rock-1.0-1.src.rock", "/busted-2.0.0-1.rockspec", "/busted-2.0.rc13-0.rockspec", diff --git a/spec/download_spec.lua b/spec/download_spec.lua index 823e154f..66b12d6f 100644 --- a/spec/download_spec.lua +++ b/spec/download_spec.lua @@ -6,7 +6,7 @@ local testing_paths = test_env.testing_paths test_env.unload_luarocks() local extra_rocks = { - "/validate-args-1.5.4-1.rockspec" + "/say-1.3-1.rockspec", } describe("luarocks download #integration", function() @@ -24,15 +24,15 @@ describe("luarocks download #integration", function() end) 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--") + assert.is_true(run.luarocks_bool("download --all say")) + assert.is.truthy(lfs.attributes("say-1.3-1.rockspec")) + test_env.remove_files(lfs.currentdir(), "say--") end) 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--") + assert.is_true(run.luarocks_bool("download --rockspec say 1.3-1")) + assert.is.truthy(lfs.attributes("say-1.3-1.rockspec")) + test_env.remove_files(lfs.currentdir(), "say--") end) describe("#namespaces", function() diff --git a/spec/fetch_spec.lua b/spec/fetch_spec.lua index 0087159b..046d7b7b 100644 --- a/spec/fetch_spec.lua +++ b/spec/fetch_spec.lua @@ -277,7 +277,7 @@ describe("luarocks fetch #unit #mock", function() end) it("returns false if the rockspec in invalid", function() - assert.falsy(fetch.load_local_rockspec(testing_paths.fixtures_dir .. "/invalid_validate-args-1.5.4-1.rockspec")) + assert.falsy(fetch.load_local_rockspec(testing_paths.fixtures_dir .. "/invalid_say-1.3-1.rockspec")) end) it("returns false if the rockspec version is not supported", function() diff --git a/spec/fixtures/invalid_say-1.3-1.rockspec b/spec/fixtures/invalid_say-1.3-1.rockspec new file mode 100644 index 00000000..890b4db2 --- /dev/null +++ b/spec/fixtures/invalid_say-1.3-1.rockspec @@ -0,0 +1,23 @@ +package = "say" +version = "1.3-1" +source = {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{++{ + url = "https://github.com/Olivine-Labs/say/archive/v1.3-1.tar.gz", + dir = "say-1.3-1" +} +description = { + summary = "Lua String Hashing/Indexing Library", + detailed = [[ + Useful for internationalization. + ]], + homepage = "http://olivinelabs.com/busted/", + license = "MIT " +} +dependencies = { + "lua >= 5.1" +} +build = { + type = "builtin", + modules = { + ["say.init"] = "src/init.lua" + } +} diff --git a/spec/fixtures/invalid_validate-args-1.5.4-1.rockspec b/spec/fixtures/invalid_validate-args-1.5.4-1.rockspec deleted file mode 100644 index 0b4d807d..00000000 --- a/spec/fixtures/invalid_validate-args-1.5.4-1.rockspec +++ /dev/null @@ -1,35 +0,0 @@ -package = 'validate-args' -version = '1.5.4-1' -source = {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{++{ - url = "https://bitbucket.org/djerius/validate.args/downloads/validate-args-1.5.4.tar.gz" -} - -description = { - summary = "Function argument validation", - detailed = [[ - validate.args is a Lua module that provides a framework for - validation of arguments to Lua functions as well as complex data - structures. The included validate.inplace module provides "live" - validation during assignment of values to elements in tables. ]], - license = "GPL-3", - -} - -dependencies = { - "lua >= 5.1" -} - -build = { - - type = "builtin", - - modules = { - ["validate.args"] = "validate/args.lua", - ["validate.inplace"] = "validate/inplace.lua", - }, - - copy_directories = { - "doc", "tests" - } - -} diff --git a/spec/lint_spec.lua b/spec/lint_spec.lua index ff7a03e9..b205cc57 100644 --- a/spec/lint_spec.lua +++ b/spec/lint_spec.lua @@ -7,7 +7,7 @@ test_env.unload_luarocks() local lfs = require("lfs") local extra_rocks = { - "/validate-args-1.5.4-1.rockspec" + "/say-1.3-1.rockspec" } describe("luarocks lint #integration", function() @@ -25,10 +25,10 @@ describe("luarocks lint #integration", function() end) 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.is_true(run.luarocks_bool("download --rockspec say 1.3-1")) + local output = run.luarocks("lint say-1.3-1.rockspec") assert.are.same(output, "") - assert.is_true(os.remove("validate-args-1.5.4-1.rockspec")) + assert.is_true(os.remove("say-1.3-1.rockspec")) end) describe("mismatch set", function() diff --git a/spec/pack_spec.lua b/spec/pack_spec.lua index beab7e8a..d81258c6 100644 --- a/spec/pack_spec.lua +++ b/spec/pack_spec.lua @@ -30,7 +30,7 @@ describe("luarocks pack #integration", function() end) it("invalid rockspec", function() - assert.is_false(run.luarocks_bool("pack " .. testing_paths.fixtures_dir .. "/invalid_validate-args-1.5.4-1.rockspec")) + assert.is_false(run.luarocks_bool("pack " .. testing_paths.fixtures_dir .. "/invalid_say-1.3-1.rockspec")) end) it("not installed rock", function() -- cgit v1.2.3-55-g6feb