diff options
| author | Mike Vink <mike@pionative.com> | 2025-02-03 21:29:42 +0100 |
|---|---|---|
| committer | Mike Vink <mike@pionative.com> | 2025-02-03 21:29:42 +0100 |
| commit | 5155816b7b925dec5d5feb1568b1d7ceb00938b9 (patch) | |
| tree | deca28ea15e79f6f804c3d90d2ba757881638af5 /spec/external_spec.lua | |
Diffstat (limited to 'spec/external_spec.lua')
| -rw-r--r-- | spec/external_spec.lua | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/spec/external_spec.lua b/spec/external_spec.lua new file mode 100644 index 0000000..5a69a67 --- /dev/null +++ b/spec/external_spec.lua @@ -0,0 +1,32 @@ +local test_env = require("spec.util.test_env") +local run = test_env.run +local testing_paths = test_env.testing_paths + +describe("luarocks external commands #integration", function() + lazy_setup(function() + test_env.setup_specs() + test_env.mock_server_init() + end) + + lazy_teardown(function() + test_env.mock_server_done() + end) + + it("installs a legacy external command", function() + local rockspec = testing_paths.fixtures_dir .. "/legacyexternalcommand-0.1-1.rockspec" + assert.is_truthy(run.luarocks_bool("build " .. rockspec)) + assert.is.truthy(run.luarocks("show legacyexternalcommand")) + local output = run.luarocks("legacyexternalcommand") + assert.match("Argument missing", output) + output = run.luarocks("legacyexternalcommand foo") + assert.match("ARG1\tfoo", output) + assert.match("ARG2\tnil", output) + output = run.luarocks("legacyexternalcommand foo bar") + assert.match("ARG1\tfoo", output) + assert.match("ARG2\tbar", output) + output = run.luarocks("legacyexternalcommand foo bar bla") + assert.match("ARG1\tfoo", output) + assert.match("ARG2\tbar", output) + end) +end) + |
