diff options
Diffstat (limited to 'spec/download_spec.lua')
-rw-r--r-- | spec/download_spec.lua | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/download_spec.lua b/spec/download_spec.lua index 64443922..152470a5 100644 --- a/spec/download_spec.lua +++ b/spec/download_spec.lua | |||
@@ -1,6 +1,7 @@ | |||
1 | local test_env = require("spec.util.test_env") | 1 | local test_env = require("spec.util.test_env") |
2 | local lfs = require("lfs") | 2 | local lfs = require("lfs") |
3 | local run = test_env.run | 3 | local run = test_env.run |
4 | local testing_paths = test_env.testing_paths | ||
4 | 5 | ||
5 | test_env.unload_luarocks() | 6 | test_env.unload_luarocks() |
6 | 7 | ||
@@ -33,4 +34,24 @@ describe("LuaRocks download tests #blackbox #b_download", function() | |||
33 | assert.is.truthy(lfs.attributes("validate-args-1.5.4-1.rockspec")) | 34 | assert.is.truthy(lfs.attributes("validate-args-1.5.4-1.rockspec")) |
34 | test_env.remove_files(lfs.currentdir(), "validate--args--") | 35 | test_env.remove_files(lfs.currentdir(), "validate--args--") |
35 | end) | 36 | end) |
37 | |||
38 | describe("#namespaces", function() | ||
39 | it("retrieves namespaced rockspec", function() | ||
40 | finally(function() | ||
41 | os.remove("a_rock-2.0-1.rockspec") | ||
42 | end) | ||
43 | assert(run.luarocks_bool("download a_user/a_rock --rockspec --server=" .. testing_paths.fixtures_dir .. "/a_repo" )) | ||
44 | assert(lfs.attributes("a_rock-2.0-1.rockspec")) | ||
45 | end) | ||
46 | |||
47 | it("retrieves namespaced rock", function() | ||
48 | finally(function() | ||
49 | os.remove("a_rock-2.0-1.src.rock") | ||
50 | end) | ||
51 | assert(run.luarocks_bool("download a_user/a_rock --server=" .. testing_paths.fixtures_dir .. "/a_repo" )) | ||
52 | assert(lfs.attributes("a_rock-2.0-1.src.rock")) | ||
53 | end) | ||
54 | end) | ||
55 | |||
56 | |||
36 | end) | 57 | end) |