summaryrefslogtreecommitdiff
path: root/spec/external_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'spec/external_spec.lua')
-rw-r--r--spec/external_spec.lua32
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)
+