diff options
| author | Hisham <hisham@gobolinux.org> | 2016-07-11 01:15:41 -0300 |
|---|---|---|
| committer | Hisham <hisham@gobolinux.org> | 2016-07-11 01:15:41 -0300 |
| commit | 994a041b4f1348564f390f3f4d8ec040c8edb4b8 (patch) | |
| tree | 128d264d86576e0b62225056769b7097a745b822 /spec/list_spec.lua | |
| parent | 41eccd4ca6fe51f8174dd43744e7a4bab4daf2cb (diff) | |
| parent | 77b41dd05a870feeb519e930472133f63cf94317 (diff) | |
| download | luarocks-994a041b4f1348564f390f3f4d8ec040c8edb4b8.tar.gz luarocks-994a041b4f1348564f390f3f4d8ec040c8edb4b8.tar.bz2 luarocks-994a041b4f1348564f390f3f4d8ec040c8edb4b8.zip | |
Merge branch 'master' of https://github.com/keplerproject/luarocks
Diffstat (limited to 'spec/list_spec.lua')
| -rw-r--r-- | spec/list_spec.lua | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/spec/list_spec.lua b/spec/list_spec.lua new file mode 100644 index 00000000..1b082ab6 --- /dev/null +++ b/spec/list_spec.lua | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | local test_env = require("test/test_environment") | ||
| 2 | local run = test_env.run | ||
| 3 | local testing_paths = test_env.testing_paths | ||
| 4 | |||
| 5 | test_env.unload_luarocks() | ||
| 6 | |||
| 7 | local extra_rocks = { | ||
| 8 | "/say-1.0-1.src.rock", | ||
| 9 | "/say-1.2-1.src.rock" | ||
| 10 | } | ||
| 11 | |||
| 12 | describe("LuaRocks list tests #blackbox #b_list", function() | ||
| 13 | |||
| 14 | before_each(function() | ||
| 15 | test_env.setup_specs(extra_rocks) | ||
| 16 | end) | ||
| 17 | |||
| 18 | it("LuaRocks list with no flags/arguments", function() | ||
| 19 | local output = run.luarocks("list") | ||
| 20 | assert.is.truthy(output:find("luacov")) | ||
| 21 | end) | ||
| 22 | |||
| 23 | it("LuaRocks list porcelain", function() | ||
| 24 | local output = run.luarocks("list --porcelain") | ||
| 25 | local path = testing_paths.testing_sys_tree:gsub("-", "--") -- !not sure! why this is good | ||
| 26 | assert.is.truthy(output:find("luacov\t0.11.0--1\tinstalled\t" .. path .. "/lib/luarocks/rocks" )) | ||
| 27 | end) | ||
| 28 | |||
| 29 | it("LuaRocks install outdated and list it", function() | ||
| 30 | assert.is_true(run.luarocks_bool("install say 1.0-1")) | ||
| 31 | local output = run.luarocks("list --outdated") | ||
| 32 | assert.is.truthy(output:find("say")) | ||
| 33 | end) | ||
| 34 | |||
| 35 | it("LuaRocks list invalid tree", function() | ||
| 36 | local output = run.luarocks("--tree=/some/invalid/tree list") | ||
| 37 | assert.are.same(output, "Installed rocks:----------------") | ||
| 38 | end) | ||
| 39 | end) | ||
