From 47a9e7571f5aefd48d5e8d168bd56f07e296b18e Mon Sep 17 00:00:00 2001 From: roboo Date: Mon, 11 Jul 2016 21:29:37 +0200 Subject: Update new_version, pack tests --- spec/new_version_spec.lua | 1 + spec/pack_spec.lua | 5 ++++ .../invalid_validate-args-1.5.4-1.rockspec | 35 ++++++++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 test/testfiles/invalid_validate-args-1.5.4-1.rockspec diff --git a/spec/new_version_spec.lua b/spec/new_version_spec.lua index 4e4d5d27..d77d32d1 100644 --- a/spec/new_version_spec.lua +++ b/spec/new_version_spec.lua @@ -30,6 +30,7 @@ describe("LuaRocks new_version tests #blackbox #b_new_version", function() it("LuaRocks new version invalid url", function() assert.is_true(run.luarocks_bool("download --rockspec abelhas 1.0")) assert.is_true(run.luarocks_bool("new_version abelhas-1.0-1.rockspec 1.1 http://luainvalid")) + assert.is.truthy(lfs.attributes("abelhas-1.1-1.rockspec")) test_env.remove_files(lfs.currentdir(), "abelhas--") end) end) diff --git a/spec/pack_spec.lua b/spec/pack_spec.lua index 416184a8..aa827682 100644 --- a/spec/pack_spec.lua +++ b/spec/pack_spec.lua @@ -1,6 +1,7 @@ local test_env = require("test/test_environment") local lfs = require("lfs") local run = test_env.run +local testing_paths = test_env.testing_paths test_env.unload_luarocks() @@ -21,6 +22,10 @@ describe("LuaRocks pack tests #blackbox #b_pack", function() assert.is_true(run.luarocks_bool("pack luacov")) assert.is_true(test_env.remove_files(lfs.currentdir(), "luacov-")) end) + + 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 src", function() assert.is_true(run.luarocks_bool("install luasec")) diff --git a/test/testfiles/invalid_validate-args-1.5.4-1.rockspec b/test/testfiles/invalid_validate-args-1.5.4-1.rockspec new file mode 100644 index 00000000..0b4d807d --- /dev/null +++ b/test/testfiles/invalid_validate-args-1.5.4-1.rockspec @@ -0,0 +1,35 @@ +package = 'validate-args' +version = '1.5.4-1' +source = {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{++{ + url = "https://bitbucket.org/djerius/validate.args/downloads/validate-args-1.5.4.tar.gz" +} + +description = { + summary = "Function argument validation", + detailed = [[ + validate.args is a Lua module that provides a framework for + validation of arguments to Lua functions as well as complex data + structures. The included validate.inplace module provides "live" + validation during assignment of values to elements in tables. ]], + license = "GPL-3", + +} + +dependencies = { + "lua >= 5.1" +} + +build = { + + type = "builtin", + + modules = { + ["validate.args"] = "validate/args.lua", + ["validate.inplace"] = "validate/inplace.lua", + }, + + copy_directories = { + "doc", "tests" + } + +} -- cgit v1.2.3-55-g6feb