aboutsummaryrefslogtreecommitdiff
path: root/spec/write_rockspec_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/write_rockspec_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/write_rockspec_spec.lua')
-rw-r--r--spec/write_rockspec_spec.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/write_rockspec_spec.lua b/spec/write_rockspec_spec.lua
index e4a7fa73..0a0988d0 100644
--- a/spec/write_rockspec_spec.lua
+++ b/spec/write_rockspec_spec.lua
@@ -42,27 +42,27 @@ describe("LuaRocks write_rockspec tests #blackbox #b_write_rockspec", function()
42 42
43 it("runs", function() 43 it("runs", function()
44 finally(function() os.remove("testrock-dev-1.rockspec") end) 44 finally(function() os.remove("testrock-dev-1.rockspec") end)
45 assert.is_true(run.luarocks_bool("write_rockspec git://localhost:20000/testrock")) 45 assert.is_true(run.luarocks_bool("write_rockspec git://localhost/testrock"))
46 assert.is.truthy(lfs.attributes("testrock-dev-1.rockspec")) 46 assert.is.truthy(lfs.attributes("testrock-dev-1.rockspec"))
47 end) 47 end)
48 48
49 it("runs with --tag", function() 49 it("runs with --tag", function()
50 finally(function() os.remove("testrock-2.3.0-1.rockspec") end) 50 finally(function() os.remove("testrock-2.3.0-1.rockspec") end)
51 assert.is_true(run.luarocks_bool("write_rockspec git://localhost:20000/testrock --tag=v2.3.0")) 51 assert.is_true(run.luarocks_bool("write_rockspec git://localhost/testrock --tag=v2.3.0"))
52 assert.is.truthy(lfs.attributes("testrock-2.3.0-1.rockspec")) 52 assert.is.truthy(lfs.attributes("testrock-2.3.0-1.rockspec"))
53 -- TODO check contents 53 -- TODO check contents
54 end) 54 end)
55 55
56 it("runs with format flag", function() 56 it("runs with format flag", function()
57 finally(function() os.remove("testrock-dev-1.rockspec") end) 57 finally(function() os.remove("testrock-dev-1.rockspec") end)
58 assert.is_true(run.luarocks_bool("write_rockspec git://localhost:20000/testrock --rockspec-format=1.1 --lua-version=5.1,5.2")) 58 assert.is_true(run.luarocks_bool("write_rockspec git://localhost/testrock --rockspec-format=1.1 --lua-version=5.1,5.2"))
59 assert.is.truthy(lfs.attributes("testrock-dev-1.rockspec")) 59 assert.is.truthy(lfs.attributes("testrock-dev-1.rockspec"))
60 -- TODO check contents 60 -- TODO check contents
61 end) 61 end)
62 62
63 it("runs with full flags", function() 63 it("runs with full flags", function()
64 finally(function() os.remove("testrock-dev-1.rockspec") end) 64 finally(function() os.remove("testrock-dev-1.rockspec") end)
65 assert.is_true(run.luarocks_bool("write_rockspec git://localhost:20000/testrock --lua-version=5.1,5.2 --license=\"MIT/X11\" " 65 assert.is_true(run.luarocks_bool("write_rockspec git://localhost/testrock --lua-version=5.1,5.2 --license=\"MIT/X11\" "
66 .. " --homepage=\"http://www.luarocks.org\" --summary=\"A package manager for Lua modules\" ")) 66 .. " --homepage=\"http://www.luarocks.org\" --summary=\"A package manager for Lua modules\" "))
67 assert.is.truthy(lfs.attributes("testrock-dev-1.rockspec")) 67 assert.is.truthy(lfs.attributes("testrock-dev-1.rockspec"))
68 -- TODO check contents 68 -- TODO check contents
@@ -70,7 +70,7 @@ describe("LuaRocks write_rockspec tests #blackbox #b_write_rockspec", function()
70 70
71 it("with various flags", function() 71 it("with various flags", function()
72 finally(function() os.remove("testrock-dev-1.rockspec") end) 72 finally(function() os.remove("testrock-dev-1.rockspec") end)
73 assert.is_true(run.luarocks_bool("write_rockspec git://localhost:20000/testrock --lib=fcgi --license=\"3-clause BSD\" " .. "--lua-version=5.1,5.2")) 73 assert.is_true(run.luarocks_bool("write_rockspec git://localhost/testrock --lib=fcgi --license=\"3-clause BSD\" " .. "--lua-version=5.1,5.2"))
74 assert.is.truthy(lfs.attributes("testrock-dev-1.rockspec")) 74 assert.is.truthy(lfs.attributes("testrock-dev-1.rockspec"))
75 -- TODO check contents 75 -- TODO check contents
76 end) 76 end)