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 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 spec/dir_spec.lua (limited to '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) -- cgit v1.2.3-55-g6feb