aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Melnichenko <mpeterval@gmail.com>2017-09-11 13:19:03 +0300
committerPeter Melnichenko <mpeterval@gmail.com>2017-09-11 13:19:03 +0300
commit85701e003241798e36b81ed1e3ed285f7bf5c7a0 (patch)
treef5af4afe237fe005d43218ed2ff244e9f085004c
parent957149e4be48fe3f87b44f73984c5b20fd8d08f1 (diff)
downloadluarocks-85701e003241798e36b81ed1e3ed285f7bf5c7a0.tar.gz
luarocks-85701e003241798e36b81ed1e3ed285f7bf5c7a0.tar.bz2
luarocks-85701e003241798e36b81ed1e3ed285f7bf5c7a0.zip
Clarify test_env.need_rock description wrt return value
-rw-r--r--spec/upload_spec.lua2
-rw-r--r--test/test_environment.lua4
2 files changed, 4 insertions, 2 deletions
diff --git a/spec/upload_spec.lua b/spec/upload_spec.lua
index 8b3e0433..6ec8e302 100644
--- a/spec/upload_spec.lua
+++ b/spec/upload_spec.lua
@@ -50,7 +50,7 @@ describe("LuaRocks upload tests #blackbox #b_upload", function()
50 50
51 describe("LuaRocks upload tests with Xavante server #mock", function() 51 describe("LuaRocks upload tests with Xavante server #mock", function()
52 before_each(function() 52 before_each(function()
53 assert.is.truthy(test_env.need_rock("restserver-xavante")) 53 assert.is_true(test_env.need_rock("restserver-xavante"))
54 local final_command = test_env.execute_helper(testing_paths.lua .. " " .. testing_paths.testing_dir .. "/mock-server.lua &", true, test_env.env_variables) 54 local final_command = test_env.execute_helper(testing_paths.lua .. " " .. testing_paths.testing_dir .. "/mock-server.lua &", true, test_env.env_variables)
55 os.execute(final_command) 55 os.execute(final_command)
56 end) 56 end)
diff --git a/test/test_environment.lua b/test/test_environment.lua
index c781af4b..bc1e5277 100644
--- a/test/test_environment.lua
+++ b/test/test_environment.lua
@@ -533,7 +533,9 @@ function test_env.setup_specs(extra_rocks)
533 end 533 end
534end 534end
535 535
536--- Test if required rock is installed if not, install it 536--- Test if required rock is installed and if not, install it.
537-- Return `true` if the rock is already installed or has been installed successfully,
538-- `false` if installation failed.
537function test_env.need_rock(rock) 539function test_env.need_rock(rock)
538 print("Check if " .. rock .. " is installed") 540 print("Check if " .. rock .. " is installed")
539 if test_env.run.luarocks_noprint_nocov(test_env.quiet("show " .. rock)) then 541 if test_env.run.luarocks_noprint_nocov(test_env.quiet("show " .. rock)) then