diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2019-11-12 19:07:24 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2019-11-29 18:36:42 -0300 |
commit | 51a2c592405c6c9fc006014973229ce1ac011d21 (patch) | |
tree | 33c53d2352f88fe8896bcfbb6a183df1c2f2566b /spec | |
parent | c00be6f54916528883fdf79b1ff99263b7a93fb5 (diff) | |
download | luarocks-51a2c592405c6c9fc006014973229ce1ac011d21.tar.gz luarocks-51a2c592405c6c9fc006014973229ce1ac011d21.tar.bz2 luarocks-51a2c592405c6c9fc006014973229ce1ac011d21.zip |
config: fix --unset
Diffstat (limited to 'spec')
-rw-r--r-- | spec/config_spec.lua | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/config_spec.lua b/spec/config_spec.lua index 2e76ae0c..f4a793c4 100644 --- a/spec/config_spec.lua +++ b/spec/config_spec.lua | |||
@@ -170,6 +170,27 @@ describe("LuaRocks config tests #integration", function() | |||
170 | end) | 170 | end) |
171 | end) | 171 | end) |
172 | 172 | ||
173 | describe("unset config keys", function() | ||
174 | it("unsets a simple config key", function() | ||
175 | test_env.run_in_tmp(function(tmpdir) | ||
176 | local myproject = tmpdir .. "/myproject" | ||
177 | lfs.mkdir(myproject) | ||
178 | lfs.chdir(myproject) | ||
179 | |||
180 | assert(run.luarocks("init")) | ||
181 | assert.truthy(run.luarocks_bool("config my_var my_value")) | ||
182 | |||
183 | local output = run.luarocks("config my_var") | ||
184 | assert.match("my_value", output) | ||
185 | |||
186 | assert.truthy(run.luarocks_bool("config my_var --unset")) | ||
187 | |||
188 | output = run.luarocks("config my_var") | ||
189 | assert.not_match("my_value", output) | ||
190 | end, finally) | ||
191 | end) | ||
192 | end) | ||
193 | |||
173 | describe("write config keys", function() | 194 | describe("write config keys", function() |
174 | it("rejects invalid --scope", function() | 195 | it("rejects invalid --scope", function() |
175 | assert.is_false(run.luarocks_bool("config web_browser foo --scope=foo")) | 196 | assert.is_false(run.luarocks_bool("config web_browser foo --scope=foo")) |