aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPeter Melnichenko <mpeterval@gmail.com>2016-07-08 15:25:54 +0300
committerPeter Melnichenko <mpeterval@gmail.com>2016-07-08 15:25:54 +0300
commit34baafd3d7a7d32bc7a3a4c519071de6355d0351 (patch)
tree09dc5492b56065b9e2cc82137cbd731797f1da40 /test
parentc700cd6eee23a46cde73017f5e1e4c06867feb2b (diff)
downloadluarocks-34baafd3d7a7d32bc7a3a4c519071de6355d0351.tar.gz
luarocks-34baafd3d7a7d32bc7a3a4c519071de6355d0351.tar.bz2
luarocks-34baafd3d7a7d32bc7a3a4c519071de6355d0351.zip
Tests: fix config creation error handling
Diffstat (limited to 'test')
-rw-r--r--test/test_environment.lua3
1 files changed, 1 insertions, 2 deletions
diff --git a/test/test_environment.lua b/test/test_environment.lua
index 1edf3987..9f22e701 100644
--- a/test/test_environment.lua
+++ b/test/test_environment.lua
@@ -198,8 +198,7 @@ end
198-- @param config_path string: path where to save config file 198-- @param config_path string: path where to save config file
199-- @param config_content string: content of this config file 199-- @param config_content string: content of this config file
200local function create_config(config_path, config_content) 200local function create_config(config_path, config_content)
201 local file, err = io.open(config_path, "w+") 201 local file = assert(io.open(config_path, "w"))
202 if not file then return nil, err end
203 file:write(config_content) 202 file:write(config_content)
204 file:close() 203 file:close()
205end 204end