diff options
Diffstat (limited to 'spec/dir_spec.lua')
| -rw-r--r-- | spec/dir_spec.lua | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/dir_spec.lua b/spec/dir_spec.lua new file mode 100644 index 00000000..04e26b57 --- /dev/null +++ b/spec/dir_spec.lua | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | local test_env = require("spec.util.test_env") | ||
| 2 | |||
| 3 | test_env.unload_luarocks() | ||
| 4 | test_env.setup_specs() | ||
| 5 | local dir = require("luarocks.dir") | ||
| 6 | |||
| 7 | describe("Luarocks dir test #unit", function() | ||
| 8 | |||
| 9 | describe("dir.is_basic_protocol", function() | ||
| 10 | it("checks whether the arguments represent a valid protocol and returns the result of the check", function() | ||
| 11 | assert.truthy(dir.is_basic_protocol("http")) | ||
| 12 | assert.truthy(dir.is_basic_protocol("https")) | ||
| 13 | assert.truthy(dir.is_basic_protocol("ftp")) | ||
| 14 | assert.truthy(dir.is_basic_protocol("file")) | ||
| 15 | assert.falsy(dir.is_basic_protocol("file", true)) | ||
| 16 | assert.falsy(dir.is_basic_protocol("invalid")) | ||
| 17 | end) | ||
| 18 | end) | ||
| 19 | end) | ||
