summaryrefslogtreecommitdiff
path: root/spec/build_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'spec/build_spec.lua')
-rw-r--r--spec/build_spec.lua26
1 files changed, 22 insertions, 4 deletions
diff --git a/spec/build_spec.lua b/spec/build_spec.lua
index ffae144d..c6d5f717 100644
--- a/spec/build_spec.lua
+++ b/spec/build_spec.lua
@@ -189,12 +189,30 @@ describe("LuaRocks build tests #blackbox #b_build", function()
189 assert.is_true(os.remove("validate-args-1.5.4-1.rockspec")) 189 assert.is_true(os.remove("validate-args-1.5.4-1.rockspec"))
190 end) 190 end)
191 191
192 it("LuaRocks build missing external", function()
193 assert.is_false(run.luarocks_bool("build " .. testing_paths.testing_dir .. "/testfiles/missing_external-0.1-1.rockspec INEXISTENT_INCDIR=\"/invalid/dir\""))
194 end)
195
196 it("LuaRocks build invalid patch", function() 192 it("LuaRocks build invalid patch", function()
197 assert.is_false(run.luarocks_bool("build " .. testing_paths.testing_dir .. "/testfiles/invalid_patch-0.1-1.rockspec")) 193 assert.is_false(run.luarocks_bool("build " .. testing_paths.testing_dir .. "/testfiles/invalid_patch-0.1-1.rockspec"))
198 end) 194 end)
199 end) 195 end)
196
197 describe("external dependencies", function()
198 setup(function()
199 test_env.mock_server_init()
200 end)
201
202 teardown(function()
203 test_env.mock_server_done()
204 end)
205
206 it("fails when missing external dependency", function()
207 assert.is_false(run.luarocks_bool("build " .. testing_paths.testing_dir .. "/testfiles/missing_external-0.1-1.rockspec INEXISTENT_INCDIR=\"/invalid/dir\""))
208 end)
209
210 it("builds with external dependency", function()
211 local rockspec = testing_paths.testing_dir .. "/testfiles/with_external_dep-0.1-1.rockspec"
212 local foo_incdir = testing_paths.testing_dir .. "/testfiles/with_external_dep"
213 assert.is_truthy(run.luarocks_bool("build " .. rockspec .. " FOO_INCDIR=\"" .. foo_incdir .. "\""))
214 assert.is.truthy(run.luarocks("show with_external_dep"))
215 end)
216 end)
217
200end) 218end)