aboutsummaryrefslogtreecommitdiff
path: root/spec/external_spec.lua
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2019-08-30 11:02:58 -0300
committerHisham Muhammad <hisham@gobolinux.org>2019-09-03 15:00:01 -0300
commitccf92207e1092ae339b74454168acca79af72d0e (patch)
tree71ea1ea96e76274e14b523ac2b0f62306dd870f6 /spec/external_spec.lua
parent0a5c5eee15072b712d0cee4cce8d642d1177ff76 (diff)
downloadluarocks-ccf92207e1092ae339b74454168acca79af72d0e.tar.gz
luarocks-ccf92207e1092ae339b74454168acca79af72d0e.tar.bz2
luarocks-ccf92207e1092ae339b74454168acca79af72d0e.zip
cmd: add compatibility mode for pre-argparse external commands
See #1070.
Diffstat (limited to 'spec/external_spec.lua')
-rw-r--r--spec/external_spec.lua33
1 files changed, 33 insertions, 0 deletions
diff --git a/spec/external_spec.lua b/spec/external_spec.lua
new file mode 100644
index 00000000..4f1b8dce
--- /dev/null
+++ b/spec/external_spec.lua
@@ -0,0 +1,33 @@
1local test_env = require("spec.util.test_env")
2local run = test_env.run
3local testing_paths = test_env.testing_paths
4
5test_env.setup_specs()
6
7describe("LuaRocks external commands #integration", function()
8 setup(function()
9 test_env.mock_server_init()
10 end)
11
12 teardown(function()
13 test_env.mock_server_done()
14 end)
15
16 it("installs a legacy external command", function()
17 local rockspec = testing_paths.fixtures_dir .. "/legacyexternalcommand-0.1-1.rockspec"
18 assert.is_truthy(run.luarocks_bool("build " .. rockspec))
19 assert.is.truthy(run.luarocks("show legacyexternalcommand"))
20 local output = run.luarocks("legacyexternalcommand")
21 assert.match("Argument missing", output)
22 output = run.luarocks("legacyexternalcommand foo")
23 assert.match("ARG1\tfoo", output)
24 assert.match("ARG2\tnil", output)
25 output = run.luarocks("legacyexternalcommand foo bar")
26 assert.match("ARG1\tfoo", output)
27 assert.match("ARG2\tbar", output)
28 output = run.luarocks("legacyexternalcommand foo bar bla")
29 assert.match("ARG1\tfoo", output)
30 assert.match("ARG2\tbar", output)
31 end)
32end)
33