diff options
| author | Hisham Muhammad <hisham@gobolinux.org> | 2018-06-05 01:58:48 -0300 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-06-06 12:39:23 -0300 |
| commit | 35d139407db87349e8ccc11e0e1696b610d9582e (patch) | |
| tree | 4b58ebeb75c96a83cab3505f2cf09c77627d2f2a /spec/dir_spec.lua | |
| parent | 03223a93763675520a2b5e16bb6ffeb871de332a (diff) | |
| download | luarocks-35d139407db87349e8ccc11e0e1696b610d9582e.tar.gz luarocks-35d139407db87349e8ccc11e0e1696b610d9582e.tar.bz2 luarocks-35d139407db87349e8ccc11e0e1696b610d9582e.zip | |
General refactor introducing Rockspec and Build.Opts objects
Adds a Rockspec object responsible for constructing all Rockspec
tables in the manner of the Queries and Results objects, and
a type-checked Build.Opts tables for build options, since
the number of attributes passed around was getting out of hand.
This allowed a major cleanup in the luarocks.build,
luarocks.fetch and luarocks.cmd.write_rockspec modules.
Diffstat (limited to 'spec/dir_spec.lua')
| -rw-r--r-- | spec/dir_spec.lua | 13 |
1 files changed, 12 insertions, 1 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 | |||
| 19 | end) | 30 | end) |
