aboutsummaryrefslogtreecommitdiff
path: root/spec/util
diff options
context:
space:
mode:
Diffstat (limited to 'spec/util')
-rw-r--r--spec/util/mock-server.lua2
-rw-r--r--spec/util/test_env.lua14
2 files changed, 9 insertions, 7 deletions
diff --git a/spec/util/mock-server.lua b/spec/util/mock-server.lua
index 244aceae..77d32927 100644
--- a/spec/util/mock-server.lua
+++ b/spec/util/mock-server.lua
@@ -70,7 +70,7 @@ server:add_resource("/file/{name:[^/]+}", {
70 path = "/", 70 path = "/",
71 produces = "text/plain", 71 produces = "text/plain",
72 handler = function(query, name) 72 handler = function(query, name)
73 local fd = io.open("spec/fixtures/"..name, "r") 73 local fd = io.open("../spec/fixtures/"..name, "r")
74 if not fd then 74 if not fd then
75 return restserver.response():status(404) 75 return restserver.response():status(404)
76 end 76 end
diff --git a/spec/util/test_env.lua b/spec/util/test_env.lua
index ce2b1728..2232de87 100644
--- a/spec/util/test_env.lua
+++ b/spec/util/test_env.lua
@@ -494,16 +494,16 @@ local function create_paths(luaversion_full)
494 testing_paths.luarocks_tmp = "/tmp/luarocks_testing" 494 testing_paths.luarocks_tmp = "/tmp/luarocks_testing"
495 end 495 end
496 496
497 testing_paths.luarocks_dir = lfs.currentdir() 497 local base_dir = lfs.currentdir()
498 498
499 if test_env.TEST_TARGET_OS == "windows" then 499 if test_env.TEST_TARGET_OS == "windows" then
500 testing_paths.luarocks_dir = testing_paths.luarocks_dir:gsub("\\","/") 500 base_dir = base_dir:gsub("\\","/")
501 end 501 end
502 502
503 testing_paths.fixtures_dir = testing_paths.luarocks_dir .. "/spec/fixtures" 503 testing_paths.fixtures_dir = base_dir .. "/spec/fixtures"
504 testing_paths.util_dir = testing_paths.luarocks_dir .. "/spec/util" 504 testing_paths.util_dir = base_dir .. "/spec/util"
505 testing_paths.testrun_dir = testing_paths.luarocks_dir .. "/testrun" 505 testing_paths.testrun_dir = base_dir .. "/testrun"
506 testing_paths.src_dir = testing_paths.luarocks_dir .. "/src" 506 testing_paths.src_dir = base_dir .. "/src"
507 testing_paths.testing_lrprefix = testing_paths.testrun_dir .. "/testing_lrprefix-" .. luaversion_full 507 testing_paths.testing_lrprefix = testing_paths.testrun_dir .. "/testing_lrprefix-" .. luaversion_full
508 testing_paths.testing_tree = testing_paths.testrun_dir .. "/testing-" .. luaversion_full 508 testing_paths.testing_tree = testing_paths.testrun_dir .. "/testing-" .. luaversion_full
509 testing_paths.testing_tree_copy = testing_paths.testrun_dir .. "/testing_copy-" .. luaversion_full 509 testing_paths.testing_tree_copy = testing_paths.testrun_dir .. "/testing_copy-" .. luaversion_full
@@ -566,6 +566,8 @@ function test_env.setup_specs(extra_rocks)
566 if test_env.RESET_ENV then 566 if test_env.RESET_ENV then
567 reset_environment(test_env.testing_paths, test_env.md5sums, test_env.env_variables) 567 reset_environment(test_env.testing_paths, test_env.md5sums, test_env.env_variables)
568 end 568 end
569
570 lfs.chdir(test_env.testing_paths.testrun_dir)
569end 571end
570 572
571--- Test if required rock is installed and if not, install it. 573--- Test if required rock is installed and if not, install it.