aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2024-02-18 21:06:10 -0300
committerHisham Muhammad <hisham@gobolinux.org>2024-02-19 08:23:41 -0300
commit21b08e29ec1d4aa887d61a27b8fa8a75232522af (patch)
tree94510019d8b3064bc700c5d8f2307e0ed712897c /spec
parentfe4cb07deb73bd9c06059d266f59f5a3a85e05c7 (diff)
downloadluarocks-21b08e29ec1d4aa887d61a27b8fa8a75232522af.tar.gz
luarocks-21b08e29ec1d4aa887d61a27b8fa8a75232522af.tar.bz2
luarocks-21b08e29ec1d4aa887d61a27b8fa8a75232522af.zip
vendor in the dkjson dependency
Fixes #1243. Fixes #1168. Fixes #559.
Diffstat (limited to 'spec')
-rw-r--r--spec/config_spec.lua16
-rw-r--r--spec/upload_spec.lua1
2 files changed, 0 insertions, 17 deletions
diff --git a/spec/config_spec.lua b/spec/config_spec.lua
index 885b022a..05da0007 100644
--- a/spec/config_spec.lua
+++ b/spec/config_spec.lua
@@ -23,17 +23,9 @@ describe("LuaRocks config tests #integration", function()
23 end) 23 end)
24 24
25 it("--json", function() 25 it("--json", function()
26 assert.is_true(run.luarocks_nocov("install dkjson"))
27 finally(function()
28 assert.is_true(run.luarocks_nocov("remove dkjson"))
29 end)
30 assert.match('"rocks_servers":[', run.luarocks("config --json"), 1, true) 26 assert.match('"rocks_servers":[', run.luarocks("config --json"), 1, true)
31 end) 27 end)
32 28
33 it("--json fails without a json library", function()
34 assert.falsy(run.luarocks_bool("config --json"))
35 end)
36
37 it("with --tree respects custom config", function() 29 it("with --tree respects custom config", function()
38 write_file("my_config.lua", [[ 30 write_file("my_config.lua", [[
39 rocks_trees = { 31 rocks_trees = {
@@ -167,18 +159,10 @@ describe("LuaRocks config tests #integration", function()
167 end) 159 end)
168 160
169 it("can read as JSON", function() 161 it("can read as JSON", function()
170 assert.is_true(run.luarocks_nocov("install dkjson"))
171 finally(function()
172 assert.is_true(run.luarocks_nocov("remove dkjson"))
173 end)
174 local output = run.luarocks("config rocks_trees --json") 162 local output = run.luarocks("config rocks_trees --json")
175 assert.match('^%["', output) 163 assert.match('^%["', output)
176 end) 164 end)
177 165
178 it("--json does not work without a json library", function()
179 assert.is_false(run.luarocks_bool("config rocks_trees --json"))
180 end)
181
182 it("reads an array -> hash config key", function() 166 it("reads an array -> hash config key", function()
183 local output = run.luarocks("config rocks_trees[2].name") 167 local output = run.luarocks("config rocks_trees[2].name")
184 assert.match("[a-z]+", output) 168 assert.match("[a-z]+", output)
diff --git a/spec/upload_spec.lua b/spec/upload_spec.lua
index 73f26cd7..119d34b6 100644
--- a/spec/upload_spec.lua
+++ b/spec/upload_spec.lua
@@ -27,7 +27,6 @@ describe("luarocks upload #integration", function()
27 end) 27 end)
28 28
29 it("force #unix", function() 29 it("force #unix", function()
30 assert.is_true(test_env.need_rock("dkjson"))
31 assert.is_false(run.luarocks_bool("upload --api-key=\"invalid\" --force " .. testing_paths.testing_server .. "/luasocket-${LUASOCKET}.rockspec")) 30 assert.is_false(run.luarocks_bool("upload --api-key=\"invalid\" --force " .. testing_paths.testing_server .. "/luasocket-${LUASOCKET}.rockspec"))
32 end) 31 end)
33 32