From 03223a93763675520a2b5e16bb6ffeb871de332a Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Mon, 4 Jun 2018 20:39:39 -0300 Subject: Tests: move is_basic_protocol to dir --- spec/dir_spec.lua | 19 +++++++++++++++++++ spec/fetch_spec.lua | 11 ----------- 2 files changed, 19 insertions(+), 11 deletions(-) create mode 100644 spec/dir_spec.lua 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 @@ +local test_env = require("spec.util.test_env") + +test_env.unload_luarocks() +test_env.setup_specs() +local dir = require("luarocks.dir") + +describe("Luarocks dir test #unit", function() + + describe("dir.is_basic_protocol", function() + it("checks whether the arguments represent a valid protocol and returns the result of the check", function() + assert.truthy(dir.is_basic_protocol("http")) + assert.truthy(dir.is_basic_protocol("https")) + assert.truthy(dir.is_basic_protocol("ftp")) + assert.truthy(dir.is_basic_protocol("file")) + assert.falsy(dir.is_basic_protocol("file", true)) + assert.falsy(dir.is_basic_protocol("invalid")) + end) + end) +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() runner.shutdown() end) - describe("fetch.is_basic_protocol", function() - it("checks whether the arguments represent a valid protocol and returns the result of the check", function() - assert.truthy(fetch.is_basic_protocol("http")) - assert.truthy(fetch.is_basic_protocol("https")) - assert.truthy(fetch.is_basic_protocol("ftp")) - assert.truthy(fetch.is_basic_protocol("file")) - assert.falsy(fetch.is_basic_protocol("file", true)) - assert.falsy(fetch.is_basic_protocol("invalid")) - end) - end) - describe("fetch.fetch_url #mock", function() setup(function() test_env.mock_server_init() -- cgit v1.2.3-55-g6feb