diff options
Diffstat (limited to 'spec/build_spec.lua')
-rw-r--r-- | spec/build_spec.lua | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/spec/build_spec.lua b/spec/build_spec.lua index 2de05879..ed36dbd2 100644 --- a/spec/build_spec.lua +++ b/spec/build_spec.lua | |||
@@ -62,6 +62,7 @@ describe("LuaRocks build tests #blackbox #b_build", function() | |||
62 | end) | 62 | end) |
63 | 63 | ||
64 | it("LuaRocks build lpeg branch=master", function() | 64 | it("LuaRocks build lpeg branch=master", function() |
65 | -- FIXME should use dev package | ||
65 | assert.is_true(run.luarocks_bool("build --branch=master lpeg")) | 66 | assert.is_true(run.luarocks_bool("build --branch=master lpeg")) |
66 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lpeg/1.0.0-1/lpeg-1.0.0-1.rockspec")) | 67 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lpeg/1.0.0-1/lpeg-1.0.0-1.rockspec")) |
67 | end) | 68 | end) |
@@ -137,6 +138,40 @@ describe("LuaRocks build tests #blackbox #b_build", function() | |||
137 | end) | 138 | end) |
138 | end) | 139 | end) |
139 | 140 | ||
141 | describe("#namespaces", function() | ||
142 | it("builds a namespaced package from the command-line", function() | ||
143 | assert(run.luarocks_bool("build a_user/a_rock --server=" .. testing_paths.fixtures_dir .. "/a_repo" )) | ||
144 | assert.is_false(run.luarocks_bool("show a_rock 1.0")) | ||
145 | assert(run.luarocks_bool("show a_rock 2.0")) | ||
146 | assert(lfs.attributes(testing_paths.testing_sys_rocks .. "/a_rock/2.0-1/rock_namespace")) | ||
147 | end) | ||
148 | |||
149 | it("builds a package with a namespaced dependency", function() | ||
150 | assert(run.luarocks_bool("build has_namespaced_dep --server=" .. testing_paths.fixtures_dir .. "/a_repo" )) | ||
151 | assert(run.luarocks_bool("show has_namespaced_dep")) | ||
152 | assert.is_false(run.luarocks_bool("show a_rock 1.0")) | ||
153 | assert(run.luarocks_bool("show a_rock 2.0")) | ||
154 | end) | ||
155 | |||
156 | it("builds a package reusing a namespaced dependency", function() | ||
157 | assert(run.luarocks_bool("build a_user/a_rock --server=" .. testing_paths.fixtures_dir .. "/a_repo" )) | ||
158 | assert(run.luarocks_bool("show a_rock 2.0")) | ||
159 | assert(lfs.attributes(testing_paths.testing_sys_rocks .. "/a_rock/2.0-1/rock_namespace")) | ||
160 | local output = run.luarocks("build has_namespaced_dep --server=" .. testing_paths.fixtures_dir .. "/a_repo" ) | ||
161 | assert.has.no.match("Missing dependencies", output) | ||
162 | end) | ||
163 | |||
164 | it("builds a package considering namespace of locally installed package", function() | ||
165 | assert(run.luarocks_bool("build a_user/a_rock --server=" .. testing_paths.fixtures_dir .. "/a_repo" )) | ||
166 | assert(run.luarocks_bool("show a_rock 2.0")) | ||
167 | assert(lfs.attributes(testing_paths.testing_sys_rocks .. "/a_rock/2.0-1/rock_namespace")) | ||
168 | local output = run.luarocks("build has_another_namespaced_dep --server=" .. testing_paths.fixtures_dir .. "/a_repo" ) | ||
169 | assert.has.match("Missing dependencies", output) | ||
170 | print(output) | ||
171 | assert(run.luarocks_bool("show a_rock 3.0")) | ||
172 | end) | ||
173 | end) | ||
174 | |||
140 | describe("LuaRocks build - more complex tests", function() | 175 | describe("LuaRocks build - more complex tests", function() |
141 | if test_env.TYPE_TEST_ENV == "full" then | 176 | if test_env.TYPE_TEST_ENV == "full" then |
142 | it("LuaRocks build luacheck show downloads test_config", function() | 177 | it("LuaRocks build luacheck show downloads test_config", function() |