diff options
author | Peter Melnichenko <mpeterval@gmail.com> | 2016-07-08 15:25:54 +0300 |
---|---|---|
committer | Peter Melnichenko <mpeterval@gmail.com> | 2016-07-08 15:25:54 +0300 |
commit | 34baafd3d7a7d32bc7a3a4c519071de6355d0351 (patch) | |
tree | 09dc5492b56065b9e2cc82137cbd731797f1da40 /test | |
parent | c700cd6eee23a46cde73017f5e1e4c06867feb2b (diff) | |
download | luarocks-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.lua | 3 |
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 |
200 | local function create_config(config_path, config_content) | 200 | local 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() |
205 | end | 204 | end |