diff options
| author | Hisham Muhammad <hisham@gobolinux.org> | 2018-06-04 20:39:39 -0300 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-06-06 12:39:02 -0300 |
| commit | 03223a93763675520a2b5e16bb6ffeb871de332a (patch) | |
| tree | 334f6bb87f7e016a1bb15f23e3c9854843277c1d | |
| parent | 6e7e522ffe3204243306cba8d128a7ec21f591f9 (diff) | |
| download | luarocks-03223a93763675520a2b5e16bb6ffeb871de332a.tar.gz luarocks-03223a93763675520a2b5e16bb6ffeb871de332a.tar.bz2 luarocks-03223a93763675520a2b5e16bb6ffeb871de332a.zip | |
Tests: move is_basic_protocol to dir
| -rw-r--r-- | spec/dir_spec.lua | 19 | ||||
| -rw-r--r-- | spec/fetch_spec.lua | 11 |
2 files changed, 19 insertions, 11 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) | ||
diff --git a/spec/fetch_spec.lua b/spec/fetch_spec.lua index 30709fcb..c02c5736 100644 --- a/spec/fetch_spec.lua +++ b/spec/fetch_spec.lua | |||
| @@ -25,17 +25,6 @@ describe("Luarocks fetch test #unit", function() | |||
| 25 | runner.shutdown() | 25 | runner.shutdown() |
| 26 | end) | 26 | end) |
| 27 | 27 | ||
| 28 | describe("fetch.is_basic_protocol", function() | ||
| 29 | it("checks whether the arguments represent a valid protocol and returns the result of the check", function() | ||
| 30 | assert.truthy(fetch.is_basic_protocol("http")) | ||
| 31 | assert.truthy(fetch.is_basic_protocol("https")) | ||
| 32 | assert.truthy(fetch.is_basic_protocol("ftp")) | ||
| 33 | assert.truthy(fetch.is_basic_protocol("file")) | ||
| 34 | assert.falsy(fetch.is_basic_protocol("file", true)) | ||
| 35 | assert.falsy(fetch.is_basic_protocol("invalid")) | ||
| 36 | end) | ||
| 37 | end) | ||
| 38 | |||
| 39 | describe("fetch.fetch_url #mock", function() | 28 | describe("fetch.fetch_url #mock", function() |
| 40 | setup(function() | 29 | setup(function() |
| 41 | test_env.mock_server_init() | 30 | test_env.mock_server_init() |
