From 2910b9a7962d9394d4797a17d9def20db5c45e7c Mon Sep 17 00:00:00 2001 From: roboo Date: Fri, 15 Jul 2016 01:26:50 +0200 Subject: New pack tests --- spec/pack_spec.lua | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) 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() local extra_rocks = { "/luasec-0.6-1.rockspec", "/luasocket-3.0rc1-1.src.rock", - "/luasocket-3.0rc1-1.rockspec" + "/luasocket-3.0rc1-1.rockspec", + "/say-1.2-1.src.rock", + "/say-1.0-1.src.rock" } describe("LuaRocks pack tests #blackbox #b_pack", function() @@ -17,6 +19,10 @@ describe("LuaRocks pack tests #blackbox #b_pack", function() test_env.setup_specs(extra_rocks) end) + it("LuaRocks pack with no flags/arguments", function() + assert.is_false(run.luarocks_bool("pack")) + end) + it("LuaRocks pack basic", function() assert.is_true(run.luarocks_bool("list")) assert.is_true(run.luarocks_bool("pack luacov")) @@ -26,6 +32,23 @@ describe("LuaRocks pack tests #blackbox #b_pack", function() it("LuaRocks pack invalid rockspec", function() assert.is_false(run.luarocks_bool("pack " .. testing_paths.testing_dir .. "/testfiles/invaild_validate-args-1.5.4-1.rockspec")) end) + + it("LuaRocks pack not installed rock", function() + assert.is_false(run.luarocks_bool("pack cjson")) + end) + + it("LuaRocks pack not installed rock from non existing manifest", function() + assert.is_false(run.luarocks_bool("pack /non/exist/temp.manif")) + end) + + it("LuaRocks pack specify which version of rock", function() + assert.is_true(run.luarocks_bool("install say 1.2")) + assert.is_true(run.luarocks_bool("install luassert")) + assert.is_true(run.luarocks_bool("install say 1.0")) + + assert.is_false(run.luarocks_bool("pack say")) + end) + it("LuaRocks pack src", function() assert.is_true(run.luarocks_bool("install luasec")) -- cgit v1.2.3-55-g6feb