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/fetch_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/fetch_spec.lua')
-rw-r--r-- | spec/fetch_spec.lua | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/fetch_spec.lua b/spec/fetch_spec.lua new file mode 100644 index 00000000..1f298733 --- /dev/null +++ b/spec/fetch_spec.lua | |||
@@ -0,0 +1,16 @@ | |||
1 | local test_env = require("test/test_environment") | ||
2 | local lfs = require("lfs") | ||
3 | |||
4 | test_env.unload_luarocks() | ||
5 | local fetch = require("luarocks.fetch") | ||
6 | |||
7 | describe("Luarocks fetch test #whitebox #w_fetch", function() | ||
8 | it("Fetch url to base dir", function() | ||
9 | assert.are.same("v0.3", fetch.url_to_base_dir("https://github.com/hishamhm/lua-compat-5.2/archive/v0.3.zip")) | ||
10 | assert.are.same("lua-compat-5.2", fetch.url_to_base_dir("https://github.com/hishamhm/lua-compat-5.2.zip")) | ||
11 | assert.are.same("lua-compat-5.2", fetch.url_to_base_dir("https://github.com/hishamhm/lua-compat-5.2.tar.gz")) | ||
12 | assert.are.same("lua-compat-5.2", fetch.url_to_base_dir("https://github.com/hishamhm/lua-compat-5.2.tar.bz2")) | ||
13 | assert.are.same("parser.moon", fetch.url_to_base_dir("git://github.com/Cirru/parser.moon")) | ||
14 | assert.are.same("v0.3", fetch.url_to_base_dir("https://github.com/hishamhm/lua-compat-5.2/archive/v0.3")) | ||
15 | end) | ||
16 | end) \ No newline at end of file | ||