diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2017-10-08 14:57:41 -0400 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2017-10-08 14:57:41 -0400 |
commit | 5aa06d43a86754f30347813803f2a9eb6f99a611 (patch) | |
tree | b4a0efac8c80caf273dc41764b139cfa3ea9af39 /spec/new_version_spec.lua | |
parent | fa91718c540542d94e8bf7df94e9fdf0cd170569 (diff) | |
download | luarocks-5aa06d43a86754f30347813803f2a9eb6f99a611.tar.gz luarocks-5aa06d43a86754f30347813803f2a9eb6f99a611.tar.bz2 luarocks-5aa06d43a86754f30347813803f2a9eb6f99a611.zip |
Tests: move mock-server utils into test_environment.lua
This avoids trouble with changing package.paths during
tests.
Diffstat (limited to 'spec/new_version_spec.lua')
-rw-r--r-- | spec/new_version_spec.lua | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/spec/new_version_spec.lua b/spec/new_version_spec.lua index 6b2e2147..29449ff5 100644 --- a/spec/new_version_spec.lua +++ b/spec/new_version_spec.lua | |||
@@ -1,12 +1,11 @@ | |||
1 | local test_env = require("test/test_environment") | 1 | local test_env = require("test/test_environment") |
2 | local test_mock_server = require("test/test_mock_server") | ||
3 | local lfs = require("lfs") | 2 | local lfs = require("lfs") |
4 | local run = test_env.run | 3 | local run = test_env.run |
5 | local testing_paths = test_env.testing_paths | 4 | local testing_paths = test_env.testing_paths |
6 | 5 | ||
7 | test_env.unload_luarocks() | 6 | test_env.unload_luarocks() |
8 | 7 | ||
9 | local extra_rocks = test_mock_server.extra_rocks({ | 8 | local extra_rocks = test_env.mock_server_extra_rocks({ |
10 | "/abelhas-1.0-1.rockspec", | 9 | "/abelhas-1.0-1.rockspec", |
11 | "/lpeg-0.12-1.rockspec" | 10 | "/lpeg-0.12-1.rockspec" |
12 | }) | 11 | }) |
@@ -38,12 +37,12 @@ describe("LuaRocks new_version tests #blackbox #b_new_version", function() | |||
38 | 37 | ||
39 | describe("LuaRocks new_version more complex tests", function() | 38 | describe("LuaRocks new_version more complex tests", function() |
40 | it("LuaRocks new version with remote spec", function() | 39 | it("LuaRocks new version with remote spec", function() |
41 | test_mock_server.init() | 40 | test_env.mock_server_init() |
42 | assert.is_true(run.luarocks_bool("new_version http://localhost:8080/file/a_rock-1.0-1.rockspec")) | 41 | assert.is_true(run.luarocks_bool("new_version http://localhost:8080/file/a_rock-1.0-1.rockspec")) |
43 | assert.is.truthy(lfs.attributes("a_rock-1.0-1.rockspec")) | 42 | assert.is.truthy(lfs.attributes("a_rock-1.0-1.rockspec")) |
44 | assert.is.truthy(lfs.attributes("a_rock-1.0-2.rockspec")) | 43 | assert.is.truthy(lfs.attributes("a_rock-1.0-2.rockspec")) |
45 | test_env.remove_files(lfs.currentdir(), "luasocket--") | 44 | test_env.remove_files(lfs.currentdir(), "luasocket--") |
46 | test_mock_server.done() | 45 | test_env.mock_server_done() |
47 | end) | 46 | end) |
48 | 47 | ||
49 | it("LuaRocks new_version of luacov", function() | 48 | it("LuaRocks new_version of luacov", function() |