aboutsummaryrefslogtreecommitdiff
path: root/spec/show_spec.lua
diff options
context:
space:
mode:
authorrobooo <robo.karasek@gmail.com>2016-07-07 21:58:19 +0200
committerHisham Muhammad <hisham@gobolinux.org>2016-07-07 16:58:19 -0300
commit5af7e0d7c2dcf65e41ae8523f3771e9528be32a7 (patch)
treebcd14624e0566a23da2e708675197d212cecf35d /spec/show_spec.lua
parentb5b285a678fe78b80d452cc9eb7565b8bf087b81 (diff)
downloadluarocks-5af7e0d7c2dcf65e41ae8523f3771e9528be32a7.tar.gz
luarocks-5af7e0d7c2dcf65e41ae8523f3771e9528be32a7.tar.bz2
luarocks-5af7e0d7c2dcf65e41ae8523f3771e9528be32a7.zip
New test-suite for LuaRocks (#581)
First version of new test-suite, using Busted framework based on Google Summer of Code project: https://summerofcode.withgoogle.com/projects/#5695811874717696 * Rewritten from Bash to Lua * Tests now check if they did what they were supposed to, beyond only checking success or failure of the `luarocks` command * Support for black-box (launching `luarocks` as an external command) and white-box (testing functions in modules directly) testing
Diffstat (limited to 'spec/show_spec.lua')
-rw-r--r--spec/show_spec.lua56
1 files changed, 56 insertions, 0 deletions
diff --git a/spec/show_spec.lua b/spec/show_spec.lua
new file mode 100644
index 00000000..85797eb6
--- /dev/null
+++ b/spec/show_spec.lua
@@ -0,0 +1,56 @@
1local test_env = require("test/test_environment")
2local lfs = require("lfs")
3
4test_env.unload_luarocks()
5local show = require("luarocks.show")
6
7expose("LuaRocks show tests #blackbox #b_show", function()
8
9 before_each(function()
10 test_env.setup_specs(extra_rocks)
11 run = test_env.run
12 end)
13
14 it("LuaRocks show with no flags/arguments", function()
15 assert.is_false(run.luarocks_bool("show"))
16 end)
17
18 describe("LuaRocks show basic tests with flags", function()
19 it("LuaRocks show invalid", function()
20 assert.is_false(run.luarocks_bool("show invalid"))
21 end)
22
23 it("LuaRocks show luacov", function()
24 local output = run.luarocks("show luacov")
25 end)
26
27 it("LuaRocks show modules of luacov", function()
28 local output = run.luarocks("show --modules luacov")
29 end)
30
31 it("LuaRocks show dependencies of luacov", function()
32 local output = run.luarocks("show --deps luacov")
33 end)
34
35 it("LuaRocks show rockspec of luacov", function()
36 local output = run.luarocks("show --rockspec luacov")
37 end)
38
39 it("LuaRocks show mversion of luacov", function()
40 local output = run.luarocks("show --mversion luacov")
41 end)
42
43 it("LuaRocks show rock tree of luacov", function()
44 local output = run.luarocks("show --rock-tree luacov")
45 end)
46
47 it("LuaRocks show rock directory of luacov", function()
48 local output = run.luarocks("show --rock-dir luacov")
49 end)
50 end)
51
52 it("LuaRocks show old version of luacov", function()
53 run.luarocks("install luacov 0.11.0")
54 run.luarocks("show luacov 0.11.0")
55 end)
56end)