aboutsummaryrefslogtreecommitdiff
path: root/spec/download_spec.lua
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2018-04-05 15:50:45 -0300
committerHisham Muhammad <hisham@gobolinux.org>2018-04-11 14:38:06 -0300
commit835d21e98e95e0ed2b6b028ddb06fe87427e5488 (patch)
tree1873e77e938a013b60ef106e1fa063f41ce159c2 /spec/download_spec.lua
parent660f088cf936dcaa65a1c7eb2793df78777ad924 (diff)
downloadluarocks-835d21e98e95e0ed2b6b028ddb06fe87427e5488.tar.gz
luarocks-835d21e98e95e0ed2b6b028ddb06fe87427e5488.tar.bz2
luarocks-835d21e98e95e0ed2b6b028ddb06fe87427e5488.zip
Add support for namespaces.
For details of the new feature, see https://github.com/luarocks/luarocks/wiki/Namespaces This ended up being a huge commit because of some major refactoring motivated by the new feature: * new modules for some object types: * `luarocks.queries` - all functions that look for rocks in local or remote repositories now use objects constructed by this module: query objects contain the name, namespace and query constraints. Dependencies in a rockspec are also stored as query objects. * `luarocks.results` - all individual results produces from queries are returned in this format: result objects contain the name, namespace, version, arch and repo. * the `results` object was renamed to `result_tree`, to better reflect that it is not an array of `result` objects. * `luarocks.vers` was removed, its functionality was moved to better locations. Specifically on namespaces: * Commands that take a rock `name` can now take `namespace/name` (and alternately `--flags=namespace` so that URLs can be also installed with a nominal namespace). * Rocks installed from a namespace now create a `rock_namespace` file alongside `rock_manifest`, which is used when matching namespaced dependencies against locally-installed rocks. * Using namespaced dependencies in a rockspec, requires `rockspec_format = "3.0"`. * Tests under the `#namespaces` hashtag, all using a local repository.
Diffstat (limited to 'spec/download_spec.lua')
-rw-r--r--spec/download_spec.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/download_spec.lua b/spec/download_spec.lua
index 64443922..152470a5 100644
--- a/spec/download_spec.lua
+++ b/spec/download_spec.lua
@@ -1,6 +1,7 @@
1local test_env = require("spec.util.test_env") 1local test_env = require("spec.util.test_env")
2local lfs = require("lfs") 2local lfs = require("lfs")
3local run = test_env.run 3local run = test_env.run
4local testing_paths = test_env.testing_paths
4 5
5test_env.unload_luarocks() 6test_env.unload_luarocks()
6 7
@@ -33,4 +34,24 @@ describe("LuaRocks download tests #blackbox #b_download", function()
33 assert.is.truthy(lfs.attributes("validate-args-1.5.4-1.rockspec")) 34 assert.is.truthy(lfs.attributes("validate-args-1.5.4-1.rockspec"))
34 test_env.remove_files(lfs.currentdir(), "validate--args--") 35 test_env.remove_files(lfs.currentdir(), "validate--args--")
35 end) 36 end)
37
38 describe("#namespaces", function()
39 it("retrieves namespaced rockspec", function()
40 finally(function()
41 os.remove("a_rock-2.0-1.rockspec")
42 end)
43 assert(run.luarocks_bool("download a_user/a_rock --rockspec --server=" .. testing_paths.fixtures_dir .. "/a_repo" ))
44 assert(lfs.attributes("a_rock-2.0-1.rockspec"))
45 end)
46
47 it("retrieves namespaced rock", function()
48 finally(function()
49 os.remove("a_rock-2.0-1.src.rock")
50 end)
51 assert(run.luarocks_bool("download a_user/a_rock --server=" .. testing_paths.fixtures_dir .. "/a_repo" ))
52 assert(lfs.attributes("a_rock-2.0-1.src.rock"))
53 end)
54 end)
55
56
36end) 57end)