aboutsummaryrefslogtreecommitdiff
path: root/spec/download_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--spec/download_spec.lua36
1 files changed, 36 insertions, 0 deletions
diff --git a/spec/download_spec.lua b/spec/download_spec.lua
new file mode 100644
index 00000000..320d9304
--- /dev/null
+++ b/spec/download_spec.lua
@@ -0,0 +1,36 @@
1local test_env = require("test/test_environment")
2local lfs = require("lfs")
3local run = test_env.run
4
5test_env.unload_luarocks()
6
7local extra_rocks = {
8 "/validate-args-1.5.4-1.rockspec"
9}
10
11describe("LuaRocks download tests #blackbox #b_download", function()
12
13 before_each(function()
14 test_env.setup_specs(extra_rocks)
15 end)
16
17 it("LuaRocks download with no flags/arguments", function()
18 assert.is_false(run.luarocks_bool("download"))
19 end)
20
21 it("LuaRocks download invalid", function()
22 assert.is_false(run.luarocks_bool("download invalid"))
23 end)
24
25 it("LuaRocks download all with delete downloaded files", function() --TODO maybe download --all more rocks
26 assert.is_true(run.luarocks_bool("download --all validate-args"))
27 assert.is.truthy(lfs.attributes("validate-args-1.5.4-1.rockspec"))
28 test_env.remove_files(lfs.currentdir(), "validate--args--")
29 end)
30
31 it("LuaRocks download rockspec version", function()
32 assert.is_true(run.luarocks_bool("download --rockspec validate-args 1.5.4-1"))
33 assert.is.truthy(lfs.attributes("validate-args-1.5.4-1.rockspec"))
34 test_env.remove_files(lfs.currentdir(), "validate--args--")
35 end)
36end)