diff options
| author | Hisham Muhammad <hisham@gobolinux.org> | 2017-10-08 01:57:17 -0300 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2017-10-08 01:57:17 -0300 |
| commit | c5bcb900a8245845dd5cd4fd8bf796591769bbee (patch) | |
| tree | 5698699bfa3a2ae778324852249d0eeca8719d3e /spec/new_version_spec.lua | |
| parent | feedb79595885c8f86ad412ef561f05664da7c14 (diff) | |
| download | luarocks-c5bcb900a8245845dd5cd4fd8bf796591769bbee.tar.gz luarocks-c5bcb900a8245845dd5cd4fd8bf796591769bbee.tar.bz2 luarocks-c5bcb900a8245845dd5cd4fd8bf796591769bbee.zip | |
Tests: use local fixture for new_version test.
Diffstat (limited to 'spec/new_version_spec.lua')
| -rw-r--r-- | spec/new_version_spec.lua | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/spec/new_version_spec.lua b/spec/new_version_spec.lua index c4185b1d..6b2e2147 100644 --- a/spec/new_version_spec.lua +++ b/spec/new_version_spec.lua | |||
| @@ -1,14 +1,15 @@ | |||
| 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") | ||
| 2 | local lfs = require("lfs") | 3 | local lfs = require("lfs") |
| 3 | local run = test_env.run | 4 | local run = test_env.run |
| 4 | local testing_paths = test_env.testing_paths | 5 | local testing_paths = test_env.testing_paths |
| 5 | 6 | ||
| 6 | test_env.unload_luarocks() | 7 | test_env.unload_luarocks() |
| 7 | 8 | ||
| 8 | local extra_rocks = { | 9 | local extra_rocks = test_mock_server.extra_rocks({ |
| 9 | "/abelhas-1.0-1.rockspec", | 10 | "/abelhas-1.0-1.rockspec", |
| 10 | "/lpeg-0.12-1.rockspec" | 11 | "/lpeg-0.12-1.rockspec" |
| 11 | } | 12 | }) |
| 12 | 13 | ||
| 13 | describe("LuaRocks new_version tests #blackbox #b_new_version", function() | 14 | describe("LuaRocks new_version tests #blackbox #b_new_version", function() |
| 14 | 15 | ||
| @@ -37,10 +38,12 @@ describe("LuaRocks new_version tests #blackbox #b_new_version", function() | |||
| 37 | 38 | ||
| 38 | describe("LuaRocks new_version more complex tests", function() | 39 | describe("LuaRocks new_version more complex tests", function() |
| 39 | it("LuaRocks new version with remote spec", function() | 40 | it("LuaRocks new version with remote spec", function() |
| 40 | assert.is_true(run.luarocks_bool("new_version https://luarocks.org/manifests/luarocks/luasocket-2.0.2-6.rockspec")) | 41 | test_mock_server.init() |
| 41 | assert.is.truthy(lfs.attributes("luasocket-2.0.2-6.rockspec")) | 42 | assert.is_true(run.luarocks_bool("new_version http://localhost:8080/file/a_rock-1.0-1.rockspec")) |
| 42 | assert.is.truthy(lfs.attributes("luasocket-2.0.2-7.rockspec")) | 43 | assert.is.truthy(lfs.attributes("a_rock-1.0-1.rockspec")) |
| 44 | assert.is.truthy(lfs.attributes("a_rock-1.0-2.rockspec")) | ||
| 43 | test_env.remove_files(lfs.currentdir(), "luasocket--") | 45 | test_env.remove_files(lfs.currentdir(), "luasocket--") |
| 46 | test_mock_server.done() | ||
| 44 | end) | 47 | end) |
| 45 | 48 | ||
| 46 | it("LuaRocks new_version of luacov", function() | 49 | it("LuaRocks new_version of luacov", function() |
