From b275d158f6c5a83324d6d2de0edc23211eb9d664 Mon Sep 17 00:00:00 2001 From: roboo Date: Sun, 10 Jul 2016 17:34:50 +0200 Subject: Doc tests --- spec/doc_spec.lua | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/spec/doc_spec.lua b/spec/doc_spec.lua index 9dbeaab8..a04d3c14 100644 --- a/spec/doc_spec.lua +++ b/spec/doc_spec.lua @@ -1,10 +1,12 @@ local test_env = require("test/test_environment") local run = test_env.run +local testing_paths = test_env.testing_paths test_env.unload_luarocks() local extra_rocks = { - "/luarepl-0.4-1.src.rock" + "/luarepl-0.4-1.src.rock", + "/c3-1.0-1.src.rock" } describe("LuaRocks doc tests #blackbox #b_doc", function() @@ -20,6 +22,21 @@ describe("LuaRocks doc tests #blackbox #b_doc", function() it("LuaRocks doc with invalid argument", function() assert.is_false(run.luarocks_bool("doc invalid")) end) + it("LuaRocks doc with no homepage", function() + assert.is_true(run.luarocks_bool("install c3")) + assert.is_false(run.luarocks_bool("doc c3 --home")) + end) + it("LuaRocks doc with no home page and no doc folder", function() + assert.is_true(run.luarocks_bool("install c3")) + test_env.remove_dir(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/c3/1.0-1/doc") + assert.is_false(run.luarocks_bool("doc c3")) + end) + it("LuaRocks doc with no doc folder opening descript.homepage", function() + assert.is_true(run.luarocks_bool("install luarepl")) + test_env.remove_dir(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/luarepl/0.4-1/doc") + local output = run.luarocks("doc luarepl") + assert.is.truthy(output:find("Local documentation directory not found")) + end) end) describe("LuaRocks doc tests with flags", function() -- cgit v1.2.3-55-g6feb