diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2016-07-14 21:48:18 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-14 21:48:18 -0300 |
commit | 42de075dd63cb35107c514b55c061bf43f3ed184 (patch) | |
tree | a4e8f5b40ea757842d34f3491608fec9b94f9e82 | |
parent | 36388709d628a76c450eed20b67f008faefc36cb (diff) | |
parent | 2910b9a7962d9394d4797a17d9def20db5c45e7c (diff) | |
download | luarocks-42de075dd63cb35107c514b55c061bf43f3ed184.tar.gz luarocks-42de075dd63cb35107c514b55c061bf43f3ed184.tar.bz2 luarocks-42de075dd63cb35107c514b55c061bf43f3ed184.zip |
Merge pull request #590 from robooo/new-tests
New pack tests
-rw-r--r-- | spec/pack_spec.lua | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/spec/pack_spec.lua b/spec/pack_spec.lua index aa827682..67ed5f3f 100644 --- a/spec/pack_spec.lua +++ b/spec/pack_spec.lua | |||
@@ -8,7 +8,9 @@ test_env.unload_luarocks() | |||
8 | local extra_rocks = { | 8 | local extra_rocks = { |
9 | "/luasec-0.6-1.rockspec", | 9 | "/luasec-0.6-1.rockspec", |
10 | "/luasocket-3.0rc1-1.src.rock", | 10 | "/luasocket-3.0rc1-1.src.rock", |
11 | "/luasocket-3.0rc1-1.rockspec" | 11 | "/luasocket-3.0rc1-1.rockspec", |
12 | "/say-1.2-1.src.rock", | ||
13 | "/say-1.0-1.src.rock" | ||
12 | } | 14 | } |
13 | 15 | ||
14 | describe("LuaRocks pack tests #blackbox #b_pack", function() | 16 | describe("LuaRocks pack tests #blackbox #b_pack", function() |
@@ -17,6 +19,10 @@ describe("LuaRocks pack tests #blackbox #b_pack", function() | |||
17 | test_env.setup_specs(extra_rocks) | 19 | test_env.setup_specs(extra_rocks) |
18 | end) | 20 | end) |
19 | 21 | ||
22 | it("LuaRocks pack with no flags/arguments", function() | ||
23 | assert.is_false(run.luarocks_bool("pack")) | ||
24 | end) | ||
25 | |||
20 | it("LuaRocks pack basic", function() | 26 | it("LuaRocks pack basic", function() |
21 | assert.is_true(run.luarocks_bool("list")) | 27 | assert.is_true(run.luarocks_bool("list")) |
22 | assert.is_true(run.luarocks_bool("pack luacov")) | 28 | assert.is_true(run.luarocks_bool("pack luacov")) |
@@ -26,6 +32,23 @@ describe("LuaRocks pack tests #blackbox #b_pack", function() | |||
26 | it("LuaRocks pack invalid rockspec", function() | 32 | it("LuaRocks pack invalid rockspec", function() |
27 | assert.is_false(run.luarocks_bool("pack " .. testing_paths.testing_dir .. "/testfiles/invaild_validate-args-1.5.4-1.rockspec")) | 33 | assert.is_false(run.luarocks_bool("pack " .. testing_paths.testing_dir .. "/testfiles/invaild_validate-args-1.5.4-1.rockspec")) |
28 | end) | 34 | end) |
35 | |||
36 | it("LuaRocks pack not installed rock", function() | ||
37 | assert.is_false(run.luarocks_bool("pack cjson")) | ||
38 | end) | ||
39 | |||
40 | it("LuaRocks pack not installed rock from non existing manifest", function() | ||
41 | assert.is_false(run.luarocks_bool("pack /non/exist/temp.manif")) | ||
42 | end) | ||
43 | |||
44 | it("LuaRocks pack specify which version of rock", function() | ||
45 | assert.is_true(run.luarocks_bool("install say 1.2")) | ||
46 | assert.is_true(run.luarocks_bool("install luassert")) | ||
47 | assert.is_true(run.luarocks_bool("install say 1.0")) | ||
48 | |||
49 | assert.is_false(run.luarocks_bool("pack say")) | ||
50 | end) | ||
51 | |||
29 | 52 | ||
30 | it("LuaRocks pack src", function() | 53 | it("LuaRocks pack src", function() |
31 | assert.is_true(run.luarocks_bool("install luasec")) | 54 | assert.is_true(run.luarocks_bool("install luasec")) |