aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/dir_spec.lua13
-rw-r--r--spec/fetch_spec.lua9
-rw-r--r--spec/util_spec.lua1
3 files changed, 12 insertions, 11 deletions
diff --git a/spec/dir_spec.lua b/spec/dir_spec.lua
index 04e26b57..27966777 100644
--- a/spec/dir_spec.lua
+++ b/spec/dir_spec.lua
@@ -12,8 +12,19 @@ describe("Luarocks dir test #unit", function()
12 assert.truthy(dir.is_basic_protocol("https")) 12 assert.truthy(dir.is_basic_protocol("https"))
13 assert.truthy(dir.is_basic_protocol("ftp")) 13 assert.truthy(dir.is_basic_protocol("ftp"))
14 assert.truthy(dir.is_basic_protocol("file")) 14 assert.truthy(dir.is_basic_protocol("file"))
15 assert.falsy(dir.is_basic_protocol("file", true)) 15 assert.falsy(dir.is_basic_protocol("git"))
16 assert.falsy(dir.is_basic_protocol("git+https"))
16 assert.falsy(dir.is_basic_protocol("invalid")) 17 assert.falsy(dir.is_basic_protocol("invalid"))
17 end) 18 end)
18 end) 19 end)
20
21 describe("dir.deduce_base_dir", function()
22 assert.are.same("v0.3", dir.deduce_base_dir("https://example.com/hishamhm/lua-compat-5.2/archive/v0.3.zip"))
23 assert.are.same("lua-compat-5.2", dir.deduce_base_dir("https://example.com/hishamhm/lua-compat-5.2.zip"))
24 assert.are.same("lua-compat-5.2", dir.deduce_base_dir("https://example.com/hishamhm/lua-compat-5.2.tar.gz"))
25 assert.are.same("lua-compat-5.2", dir.deduce_base_dir("https://example.com/hishamhm/lua-compat-5.2.tar.bz2"))
26 assert.are.same("parser.moon", dir.deduce_base_dir("git://example.com/Cirru/parser.moon"))
27 assert.are.same("v0.3", dir.deduce_base_dir("https://example.com/hishamhm/lua-compat-5.2/archive/v0.3"))
28 end)
29
19end) 30end)
diff --git a/spec/fetch_spec.lua b/spec/fetch_spec.lua
index c02c5736..aa107970 100644
--- a/spec/fetch_spec.lua
+++ b/spec/fetch_spec.lua
@@ -208,15 +208,6 @@ describe("Luarocks fetch test #unit", function()
208 end) 208 end)
209 end) 209 end)
210 210
211 describe("fetch.url_to_base_dir", function()
212 assert.are.same("v0.3", fetch.url_to_base_dir("https://example.com/hishamhm/lua-compat-5.2/archive/v0.3.zip"))
213 assert.are.same("lua-compat-5.2", fetch.url_to_base_dir("https://example.com/hishamhm/lua-compat-5.2.zip"))
214 assert.are.same("lua-compat-5.2", fetch.url_to_base_dir("https://example.com/hishamhm/lua-compat-5.2.tar.gz"))
215 assert.are.same("lua-compat-5.2", fetch.url_to_base_dir("https://example.com/hishamhm/lua-compat-5.2.tar.bz2"))
216 assert.are.same("parser.moon", fetch.url_to_base_dir("git://example.com/Cirru/parser.moon"))
217 assert.are.same("v0.3", fetch.url_to_base_dir("https://example.com/hishamhm/lua-compat-5.2/archive/v0.3"))
218 end)
219
220 describe("fetch.load_local_rockspec", function() 211 describe("fetch.load_local_rockspec", function()
221 it("returns a table representing the rockspec from the given file skipping some checks if the quick argument is enabled", function() 212 it("returns a table representing the rockspec from the given file skipping some checks if the quick argument is enabled", function()
222 local rockspec = fetch.load_local_rockspec(testing_paths.fixtures_dir .. "/a_rock-1.0-1.rockspec", true) 213 local rockspec = fetch.load_local_rockspec(testing_paths.fixtures_dir .. "/a_rock-1.0-1.rockspec", true)
diff --git a/spec/util_spec.lua b/spec/util_spec.lua
index 28f99550..3bb97a5b 100644
--- a/spec/util_spec.lua
+++ b/spec/util_spec.lua
@@ -2,7 +2,6 @@ local test_env = require("spec.util.test_env")
2local lfs = require("lfs") 2local lfs = require("lfs")
3local run = test_env.run 3local run = test_env.run
4local testing_paths = test_env.testing_paths 4local testing_paths = test_env.testing_paths
5local env_variables = test_env.env_variables
6 5
7describe("Basic tests #integration", function() 6describe("Basic tests #integration", function()
8 7