diff options
| author | William Boman <william@redwill.se> | 2022-04-11 01:04:06 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-11 01:04:06 +0200 |
| commit | 89abfcd2fbd56c3246772726a85ed0e548d77d3b (patch) | |
| tree | 5a90c3277ee853fe6c1c04be09982b94472f45ab /tests/core/managers/cargo_spec.lua | |
| parent | sumneko_lua: support Linux arm64 (#391) (diff) | |
| download | mason-89abfcd2fbd56c3246772726a85ed0e548d77d3b.tar mason-89abfcd2fbd56c3246772726a85ed0e548d77d3b.tar.gz mason-89abfcd2fbd56c3246772726a85ed0e548d77d3b.tar.bz2 mason-89abfcd2fbd56c3246772726a85ed0e548d77d3b.tar.lz mason-89abfcd2fbd56c3246772726a85ed0e548d77d3b.tar.xz mason-89abfcd2fbd56c3246772726a85ed0e548d77d3b.tar.zst mason-89abfcd2fbd56c3246772726a85ed0e548d77d3b.zip | |
make install context available via coroutine context (#586)
Diffstat (limited to 'tests/core/managers/cargo_spec.lua')
| -rw-r--r-- | tests/core/managers/cargo_spec.lua | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/tests/core/managers/cargo_spec.lua b/tests/core/managers/cargo_spec.lua index 303bf5d0..636a5f24 100644 --- a/tests/core/managers/cargo_spec.lua +++ b/tests/core/managers/cargo_spec.lua @@ -2,6 +2,7 @@ local spy = require "luassert.spy" local match = require "luassert.match" local mock = require "luassert.mock" local Optional = require "nvim-lsp-installer.core.optional" +local installer = require "nvim-lsp-installer.core.installer" local cargo = require "nvim-lsp-installer.core.managers.cargo" local Result = require "nvim-lsp-installer.core.result" local spawn = require "nvim-lsp-installer.core.spawn" @@ -21,7 +22,7 @@ describe("cargo manager", function() "should call cargo install", async_test(function() ctx.requested_version = Optional.of "42.13.37" - cargo.crate "my-crate"(ctx) + installer.run_installer(ctx, cargo.crate "my-crate") assert.spy(ctx.spawn.cargo).was_called(1) assert.spy(ctx.spawn.cargo).was_called_with { "install", @@ -38,7 +39,7 @@ describe("cargo manager", function() it( "should call cargo install with git source", async_test(function() - cargo.crate("https://my-crate.git", { git = true })(ctx) + installer.run_installer(ctx, cargo.crate("https://my-crate.git", { git = true })) assert.spy(ctx.spawn.cargo).was_called(1) assert.spy(ctx.spawn.cargo).was_called_with { "install", @@ -56,9 +57,7 @@ describe("cargo manager", function() "should respect options", async_test(function() ctx.requested_version = Optional.of "42.13.37" - cargo.crate("my-crate", { - features = "lsp", - })(ctx) + installer.run_installer(ctx, cargo.crate("my-crate", { features = "lsp" })) assert.spy(ctx.spawn.cargo).was_called(1) assert.spy(ctx.spawn.cargo).was_called_with { "install", @@ -77,9 +76,12 @@ describe("cargo manager", function() async_test(function() ctx.requested_version = Optional.of "42.13.37" local err = assert.has_error(function() - cargo.crate("my-crate", { - git = true, - })(ctx) + installer.run_installer( + ctx, + cargo.crate("my-crate", { + git = true, + }) + ) end) assert.equals("Providing a version when installing a git crate is not allowed.", err) assert.spy(ctx.spawn.cargo).was_called(0) @@ -89,7 +91,7 @@ describe("cargo manager", function() it( "should provide receipt information", async_test(function() - cargo.crate "main-package"(ctx) + installer.run_installer(ctx, cargo.crate "main-package") assert.equals( vim.inspect { type = "cargo", |
