diff options
Diffstat (limited to 'spec/add_spec.lua')
| -rw-r--r-- | spec/add_spec.lua | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/spec/add_spec.lua b/spec/add_spec.lua new file mode 100644 index 00000000..dca6f850 --- /dev/null +++ b/spec/add_spec.lua | |||
| @@ -0,0 +1,44 @@ | |||
| 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 | "/luasocket-3.0rc1-1.src.rock", | ||
| 9 | "/luasocket-3.0rc1-1.rockspec" | ||
| 10 | } | ||
| 11 | |||
| 12 | describe("LuaRocks add tests #blackbox #b_add", function() | ||
| 13 | |||
| 14 | before_each(function() | ||
| 15 | test_env.setup_specs(extra_rocks) | ||
| 16 | end) | ||
| 17 | |||
| 18 | describe("LuaRocks-admin add tests", function() | ||
| 19 | it("LuaRocks-admin add invalid rock #ssh", function() | ||
| 20 | assert.is_false(run.luarocks_admin_bool("--server=testing add invalid")) | ||
| 21 | end) | ||
| 22 | |||
| 23 | it("LuaRocks-admin add missing argument", function() | ||
| 24 | assert.is_false(run.luarocks_admin_bool("--server=testing add")) | ||
| 25 | end) | ||
| 26 | |||
| 27 | it("LuaRocks-admin add invalid server", function() | ||
| 28 | assert.is_false(run.luarocks_admin_bool("--server=invalid add " .. testing_paths.testing_server .. "/luasocket-3.0rc1-1.src.rock")) | ||
| 29 | end) | ||
| 30 | |||
| 31 | it("LuaRocks-admin add invalid server #ssh", function() | ||
| 32 | assert.is_true(run.luarocks_admin_bool("--server=testing add " .. testing_paths.testing_server .. "/luasocket-3.0rc1-1.src.rock")) | ||
| 33 | end) | ||
| 34 | |||
| 35 | --TODO This test fails, sftp not implemented | ||
| 36 | it("LuaRocks-admin add invalid server", function() --? | ||
| 37 | assert.is_false(run.luarocks_admin_bool("--server=testing add luasocket-3.0rc1-1.src.rock", { LUAROCKS_CONFIG = testing_paths.testing_dir .. "/testing_config_sftp.lua" } )) | ||
| 38 | end) | ||
| 39 | |||
| 40 | it("LuaRocks-admin add, split server url", function() | ||
| 41 | assert.is_false(run.luarocks_admin_bool("--server=\"localhost@/tmp/luarocks_testing\" add " .. testing_paths.testing_server .. "luasocket-3.0rc1-1.src.rock")) | ||
| 42 | end) | ||
| 43 | end) | ||
| 44 | end) | ||
