aboutsummaryrefslogtreecommitdiff
path: root/spec/make_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'spec/make_spec.lua')
-rw-r--r--spec/make_spec.lua27
1 files changed, 18 insertions, 9 deletions
diff --git a/spec/make_spec.lua b/spec/make_spec.lua
index 88b35b22..bb219b68 100644
--- a/spec/make_spec.lua
+++ b/spec/make_spec.lua
@@ -21,12 +21,23 @@ describe("LuaRocks make tests #blackbox #b_make", function()
21 end) 21 end)
22 22
23 it("LuaRocks make with no flags/arguments", function() 23 it("LuaRocks make with no flags/arguments", function()
24 lfs.chdir("test") 24 finally(function()
25 lfs.chdir(testing_paths.testrun_dir)
26 test_env.remove_dir("empty")
27 end)
28 assert(lfs.mkdir("empty"))
29 assert(lfs.chdir("empty"))
25 assert.is_false(run.luarocks_bool("make")) 30 assert.is_false(run.luarocks_bool("make"))
26 lfs.chdir(testing_paths.luarocks_dir)
27 end) 31 end)
28 32
29 it("LuaRocks make with rockspec", function() 33 it("LuaRocks make with rockspec", function()
34 finally(function()
35 -- delete downloaded and unpacked files
36 lfs.chdir(testing_paths.testrun_dir)
37 test_env.remove_dir("luasocket-3.0rc1-2")
38 os.remove("luasocket-3.0rc1-2.src.rock")
39 end)
40
30 -- make luasocket 41 -- make luasocket
31 assert.is_true(run.luarocks_bool("download --source luasocket 3.0rc1-2")) 42 assert.is_true(run.luarocks_bool("download --source luasocket 3.0rc1-2"))
32 assert.is_true(run.luarocks_bool("unpack luasocket-3.0rc1-2.src.rock")) 43 assert.is_true(run.luarocks_bool("unpack luasocket-3.0rc1-2.src.rock"))
@@ -36,11 +47,6 @@ describe("LuaRocks make tests #blackbox #b_make", function()
36 -- test it 47 -- test it
37 assert.is_true(run.luarocks_bool("show luasocket")) 48 assert.is_true(run.luarocks_bool("show luasocket"))
38 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/luasocket/3.0rc1-2/luasocket-3.0rc1-2.rockspec")) 49 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/luasocket/3.0rc1-2/luasocket-3.0rc1-2.rockspec"))
39
40 -- delete downloaded and unpacked files
41 lfs.chdir(testing_paths.luarocks_dir)
42 test_env.remove_dir("luasocket-3.0rc1-2")
43 assert.is_true(os.remove("luasocket-3.0rc1-2.src.rock"))
44 end) 50 end)
45 51
46 describe("LuaRocks making rockspecs (using lxsh)", function() 52 describe("LuaRocks making rockspecs (using lxsh)", function()
@@ -53,7 +59,7 @@ describe("LuaRocks make tests #blackbox #b_make", function()
53 59
54 -- delete downloaded and unpacked files 60 -- delete downloaded and unpacked files
55 after_each(function() 61 after_each(function()
56 assert.is_true(lfs.chdir(testing_paths.luarocks_dir)) 62 assert(lfs.chdir(testing_paths.testrun_dir))
57 test_env.remove_dir("lxsh-0.8.6-2") 63 test_env.remove_dir("lxsh-0.8.6-2")
58 assert.is_true(os.remove("lxsh-0.8.6-2.src.rock")) 64 assert.is_true(os.remove("lxsh-0.8.6-2.src.rock"))
59 end) 65 end)
@@ -67,12 +73,15 @@ describe("LuaRocks make tests #blackbox #b_make", function()
67 end) 73 end)
68 74
69 it("LuaRocks make unnamed rockspec", function() 75 it("LuaRocks make unnamed rockspec", function()
76 finally(function()
77 os.remove("rockspec")
78 end)
79
70 test_env.copy("lxsh-0.8.6-2.rockspec", "rockspec") 80 test_env.copy("lxsh-0.8.6-2.rockspec", "rockspec")
71 assert.is_true(run.luarocks_bool("make")) 81 assert.is_true(run.luarocks_bool("make"))
72 82
73 assert.is_true(run.luarocks_bool("show lxsh")) 83 assert.is_true(run.luarocks_bool("show lxsh"))
74 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lxsh/0.8.6-2/lxsh-0.8.6-2.rockspec")) 84 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lxsh/0.8.6-2/lxsh-0.8.6-2.rockspec"))
75 os.remove("rockspec")
76 end) 85 end)
77 86
78 it("LuaRocks make ambiguous rockspec", function() 87 it("LuaRocks make ambiguous rockspec", function()