aboutsummaryrefslogtreecommitdiff
path: root/spec/config_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'spec/config_spec.lua')
-rw-r--r--spec/config_spec.lua16
1 files changed, 0 insertions, 16 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)