diff options
author | roboo <robo.karasek@gmail.com> | 2016-07-17 23:12:15 +0200 |
---|---|---|
committer | roboo <robo.karasek@gmail.com> | 2016-07-17 23:12:15 +0200 |
commit | 41c8fba1bc527484809613b36eb0de23f323bb74 (patch) | |
tree | 07c729341f0cf173850799eaa5f5d0756bdfe155 /test | |
parent | fe8b7e8f1313f08d8aa41239f7836539a88e9c46 (diff) | |
download | luarocks-41c8fba1bc527484809613b36eb0de23f323bb74.tar.gz luarocks-41c8fba1bc527484809613b36eb0de23f323bb74.tar.bz2 luarocks-41c8fba1bc527484809613b36eb0de23f323bb74.zip |
Fix of mock server setup
Diffstat (limited to 'test')
-rw-r--r-- | test/test_environment.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/test_environment.lua b/test/test_environment.lua index eb545a47..dcad92cf 100644 --- a/test/test_environment.lua +++ b/test/test_environment.lua | |||
@@ -41,7 +41,7 @@ end | |||
41 | -- @param print_command boolean: print command if 'true' | 41 | -- @param print_command boolean: print command if 'true' |
42 | -- @param env_variables table: table of environment variables to export {FOO="bar", BAR="foo"} | 42 | -- @param env_variables table: table of environment variables to export {FOO="bar", BAR="foo"} |
43 | -- @return final_command string: concatenated command to execution | 43 | -- @return final_command string: concatenated command to execution |
44 | local function execute_helper(command, print_command, env_variables) | 44 | function test_env.execute_helper(command, print_command, env_variables) |
45 | local final_command = "" | 45 | local final_command = "" |
46 | 46 | ||
47 | if print_command then | 47 | if print_command then |
@@ -66,7 +66,7 @@ end | |||
66 | -- In Lua5.1 os.execute returns numeric value, but in Lua5.2+ returns boolean | 66 | -- In Lua5.1 os.execute returns numeric value, but in Lua5.2+ returns boolean |
67 | -- @return true/false boolean: status of the command execution | 67 | -- @return true/false boolean: status of the command execution |
68 | local function execute_bool(command, print_command, env_variables) | 68 | local function execute_bool(command, print_command, env_variables) |
69 | command = execute_helper(command, print_command, env_variables) | 69 | command = test_env.execute_helper(command, print_command, env_variables) |
70 | 70 | ||
71 | local ok = os.execute(command) | 71 | local ok = os.execute(command) |
72 | return ok == true or ok == 0 | 72 | return ok == true or ok == 0 |
@@ -75,7 +75,7 @@ end | |||
75 | --- Execute command and returns output of command | 75 | --- Execute command and returns output of command |
76 | -- @return output string: output the command execution | 76 | -- @return output string: output the command execution |
77 | local function execute_output(command, print_command, env_variables) | 77 | local function execute_output(command, print_command, env_variables) |
78 | command = execute_helper(command, print_command, env_variables) | 78 | command = test_env.execute_helper(command, print_command, env_variables) |
79 | 79 | ||
80 | local file = assert(io.popen(command)) | 80 | local file = assert(io.popen(command)) |
81 | local output = file:read('*all') | 81 | local output = file:read('*all') |