diff options
Diffstat (limited to 'spec/doc_spec.lua')
| -rw-r--r-- | spec/doc_spec.lua | 19 |
1 files changed, 18 insertions, 1 deletions
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 @@ | |||
| 1 | local test_env = require("test/test_environment") | 1 | local test_env = require("test/test_environment") |
| 2 | local run = test_env.run | 2 | local run = test_env.run |
| 3 | local testing_paths = test_env.testing_paths | ||
| 3 | 4 | ||
| 4 | test_env.unload_luarocks() | 5 | test_env.unload_luarocks() |
| 5 | 6 | ||
| 6 | local extra_rocks = { | 7 | local extra_rocks = { |
| 7 | "/luarepl-0.4-1.src.rock" | 8 | "/luarepl-0.4-1.src.rock", |
| 9 | "/c3-1.0-1.src.rock" | ||
| 8 | } | 10 | } |
| 9 | 11 | ||
| 10 | describe("LuaRocks doc tests #blackbox #b_doc", function() | 12 | describe("LuaRocks doc tests #blackbox #b_doc", function() |
| @@ -20,6 +22,21 @@ describe("LuaRocks doc tests #blackbox #b_doc", function() | |||
| 20 | it("LuaRocks doc with invalid argument", function() | 22 | it("LuaRocks doc with invalid argument", function() |
| 21 | assert.is_false(run.luarocks_bool("doc invalid")) | 23 | assert.is_false(run.luarocks_bool("doc invalid")) |
| 22 | end) | 24 | end) |
| 25 | it("LuaRocks doc with no homepage", function() | ||
| 26 | assert.is_true(run.luarocks_bool("install c3")) | ||
| 27 | assert.is_false(run.luarocks_bool("doc c3 --home")) | ||
| 28 | end) | ||
| 29 | it("LuaRocks doc with no home page and no doc folder", function() | ||
| 30 | assert.is_true(run.luarocks_bool("install c3")) | ||
| 31 | test_env.remove_dir(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/c3/1.0-1/doc") | ||
| 32 | assert.is_false(run.luarocks_bool("doc c3")) | ||
| 33 | end) | ||
| 34 | it("LuaRocks doc with no doc folder opening descript.homepage", function() | ||
| 35 | assert.is_true(run.luarocks_bool("install luarepl")) | ||
| 36 | test_env.remove_dir(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/luarepl/0.4-1/doc") | ||
| 37 | local output = run.luarocks("doc luarepl") | ||
| 38 | assert.is.truthy(output:find("Local documentation directory not found")) | ||
| 39 | end) | ||
| 23 | end) | 40 | end) |
| 24 | 41 | ||
| 25 | describe("LuaRocks doc tests with flags", function() | 42 | describe("LuaRocks doc tests with flags", function() |
