diff options
| author | robooo <robo.karasek@gmail.com> | 2016-07-07 21:58:19 +0200 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2016-07-07 16:58:19 -0300 |
| commit | 5af7e0d7c2dcf65e41ae8523f3771e9528be32a7 (patch) | |
| tree | bcd14624e0566a23da2e708675197d212cecf35d /spec/pack_spec.lua | |
| parent | b5b285a678fe78b80d452cc9eb7565b8bf087b81 (diff) | |
| download | luarocks-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/pack_spec.lua')
| -rw-r--r-- | spec/pack_spec.lua | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/spec/pack_spec.lua b/spec/pack_spec.lua new file mode 100644 index 00000000..a07e7ed2 --- /dev/null +++ b/spec/pack_spec.lua | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | local test_env = require("test/test_environment") | ||
| 2 | local lfs = require("lfs") | ||
| 3 | |||
| 4 | test_env.unload_luarocks() | ||
| 5 | local pack = require("luarocks.pack") | ||
| 6 | |||
| 7 | local extra_rocks = { | ||
| 8 | "/luasec-0.6-1.rockspec", | ||
| 9 | "/luasocket-3.0rc1-1.src.rock", | ||
| 10 | "/luasocket-3.0rc1-1.rockspec" | ||
| 11 | } | ||
| 12 | |||
| 13 | expose("LuaRocks pack tests #blackbox #b_pack", function() | ||
| 14 | |||
| 15 | before_each(function() | ||
| 16 | test_env.setup_specs(extra_rocks) | ||
| 17 | testing_paths = test_env.testing_paths | ||
| 18 | run = test_env.run | ||
| 19 | end) | ||
| 20 | |||
| 21 | it("LuaRocks pack basic", function() | ||
| 22 | assert.is_true(run.luarocks_bool("list")) | ||
| 23 | assert.is_true(run.luarocks_bool("pack luacov")) | ||
| 24 | assert.is_true(test_env.remove_files(lfs.currentdir(), "luacov-")) | ||
| 25 | end) | ||
| 26 | |||
| 27 | it("LuaRocks pack src", function() | ||
| 28 | assert.is_true(run.luarocks_bool("install luasec")) | ||
| 29 | assert.is_true(run.luarocks_bool("download --rockspec luasocket")) | ||
| 30 | assert.is_true(run.luarocks_bool("pack luasocket-3.0rc1-1.rockspec")) | ||
| 31 | assert.is_true(test_env.remove_files(lfs.currentdir(), "luasocket-")) | ||
| 32 | end) | ||
| 33 | end) | ||
| 34 | |||
| 35 | |||
