aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2022-03-06 14:50:49 -0300
committerHisham Muhammad <hisham@gobolinux.org>2022-03-06 23:04:20 -0300
commit2fac17d4d211adf9c1fe9668094febb55ee92389 (patch)
tree5a208594d4598a78c1b7786156c212b6235c587b /spec
parent1138b2c1d84cee1dd165b17bd353e2ca38466eb7 (diff)
downloadluarocks-2fac17d4d211adf9c1fe9668094febb55ee92389.tar.gz
luarocks-2fac17d4d211adf9c1fe9668094febb55ee92389.tar.bz2
luarocks-2fac17d4d211adf9c1fe9668094febb55ee92389.zip
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.
Diffstat (limited to 'spec')
-rw-r--r--spec/build_spec.lua1
-rw-r--r--spec/download_spec.lua14
-rw-r--r--spec/fetch_spec.lua2
-rw-r--r--spec/fixtures/invalid_say-1.3-1.rockspec23
-rw-r--r--spec/fixtures/invalid_validate-args-1.5.4-1.rockspec35
-rw-r--r--spec/lint_spec.lua8
-rw-r--r--spec/pack_spec.lua2
7 files changed, 36 insertions, 49 deletions
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 = {
23 "/luasocket-3.0rc1-2.src.rock", 23 "/luasocket-3.0rc1-2.src.rock",
24 "/luasocket-3.0rc1-2.rockspec", 24 "/luasocket-3.0rc1-2.rockspec",
25 "/stdlib-41.0.0-1.src.rock", 25 "/stdlib-41.0.0-1.src.rock",
26 "/validate-args-1.5.4-1.rockspec",
27 "spec/fixtures/a_rock-1.0-1.src.rock", 26 "spec/fixtures/a_rock-1.0-1.src.rock",
28 "/busted-2.0.0-1.rockspec", 27 "/busted-2.0.0-1.rockspec",
29 "/busted-2.0.rc13-0.rockspec", 28 "/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
6test_env.unload_luarocks() 6test_env.unload_luarocks()
7 7
8local extra_rocks = { 8local extra_rocks = {
9 "/validate-args-1.5.4-1.rockspec" 9 "/say-1.3-1.rockspec",
10} 10}
11 11
12describe("luarocks download #integration", function() 12describe("luarocks download #integration", function()
@@ -24,15 +24,15 @@ describe("luarocks download #integration", function()
24 end) 24 end)
25 25
26 it("all with delete downloaded files", function() --TODO maybe download --all more rocks 26 it("all with delete downloaded files", function() --TODO maybe download --all more rocks
27 assert.is_true(run.luarocks_bool("download --all validate-args")) 27 assert.is_true(run.luarocks_bool("download --all say"))
28 assert.is.truthy(lfs.attributes("validate-args-1.5.4-1.rockspec")) 28 assert.is.truthy(lfs.attributes("say-1.3-1.rockspec"))
29 test_env.remove_files(lfs.currentdir(), "validate--args--") 29 test_env.remove_files(lfs.currentdir(), "say--")
30 end) 30 end)
31 31
32 it("rockspec version", function() 32 it("rockspec version", function()
33 assert.is_true(run.luarocks_bool("download --rockspec validate-args 1.5.4-1")) 33 assert.is_true(run.luarocks_bool("download --rockspec say 1.3-1"))
34 assert.is.truthy(lfs.attributes("validate-args-1.5.4-1.rockspec")) 34 assert.is.truthy(lfs.attributes("say-1.3-1.rockspec"))
35 test_env.remove_files(lfs.currentdir(), "validate--args--") 35 test_env.remove_files(lfs.currentdir(), "say--")
36 end) 36 end)
37 37
38 describe("#namespaces", function() 38 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()
277 end) 277 end)
278 278
279 it("returns false if the rockspec in invalid", function() 279 it("returns false if the rockspec in invalid", function()
280 assert.falsy(fetch.load_local_rockspec(testing_paths.fixtures_dir .. "/invalid_validate-args-1.5.4-1.rockspec")) 280 assert.falsy(fetch.load_local_rockspec(testing_paths.fixtures_dir .. "/invalid_say-1.3-1.rockspec"))
281 end) 281 end)
282 282
283 it("returns false if the rockspec version is not supported", function() 283 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 @@
1package = "say"
2version = "1.3-1"
3source = {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{++{
4 url = "https://github.com/Olivine-Labs/say/archive/v1.3-1.tar.gz",
5 dir = "say-1.3-1"
6}
7description = {
8 summary = "Lua String Hashing/Indexing Library",
9 detailed = [[
10 Useful for internationalization.
11 ]],
12 homepage = "http://olivinelabs.com/busted/",
13 license = "MIT <http://opensource.org/licenses/MIT>"
14}
15dependencies = {
16 "lua >= 5.1"
17}
18build = {
19 type = "builtin",
20 modules = {
21 ["say.init"] = "src/init.lua"
22 }
23}
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 @@
1package = 'validate-args'
2version = '1.5.4-1'
3source = {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{++{
4 url = "https://bitbucket.org/djerius/validate.args/downloads/validate-args-1.5.4.tar.gz"
5}
6
7description = {
8 summary = "Function argument validation",
9 detailed = [[
10 validate.args is a Lua module that provides a framework for
11 validation of arguments to Lua functions as well as complex data
12 structures. The included validate.inplace module provides "live"
13 validation during assignment of values to elements in tables. ]],
14 license = "GPL-3",
15
16}
17
18dependencies = {
19 "lua >= 5.1"
20}
21
22build = {
23
24 type = "builtin",
25
26 modules = {
27 ["validate.args"] = "validate/args.lua",
28 ["validate.inplace"] = "validate/inplace.lua",
29 },
30
31 copy_directories = {
32 "doc", "tests"
33 }
34
35}
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()
7local lfs = require("lfs") 7local lfs = require("lfs")
8 8
9local extra_rocks = { 9local extra_rocks = {
10 "/validate-args-1.5.4-1.rockspec" 10 "/say-1.3-1.rockspec"
11} 11}
12 12
13describe("luarocks lint #integration", function() 13describe("luarocks lint #integration", function()
@@ -25,10 +25,10 @@ describe("luarocks lint #integration", function()
25 end) 25 end)
26 26
27 it("OK", function() 27 it("OK", function()
28 assert.is_true(run.luarocks_bool("download --rockspec validate-args 1.5.4-1")) 28 assert.is_true(run.luarocks_bool("download --rockspec say 1.3-1"))
29 local output = run.luarocks("lint validate-args-1.5.4-1.rockspec") 29 local output = run.luarocks("lint say-1.3-1.rockspec")
30 assert.are.same(output, "") 30 assert.are.same(output, "")
31 assert.is_true(os.remove("validate-args-1.5.4-1.rockspec")) 31 assert.is_true(os.remove("say-1.3-1.rockspec"))
32 end) 32 end)
33 33
34 describe("mismatch set", function() 34 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()
30 end) 30 end)
31 31
32 it("invalid rockspec", function() 32 it("invalid rockspec", function()
33 assert.is_false(run.luarocks_bool("pack " .. testing_paths.fixtures_dir .. "/invalid_validate-args-1.5.4-1.rockspec")) 33 assert.is_false(run.luarocks_bool("pack " .. testing_paths.fixtures_dir .. "/invalid_say-1.3-1.rockspec"))
34 end) 34 end)
35 35
36 it("not installed rock", function() 36 it("not installed rock", function()