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/git_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/git_spec.lua')
| -rw-r--r-- | tests/core/managers/git_spec.lua | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/tests/core/managers/git_spec.lua b/tests/core/managers/git_spec.lua index 2f6c6ace..b73760ee 100644 --- a/tests/core/managers/git_spec.lua +++ b/tests/core/managers/git_spec.lua @@ -2,6 +2,7 @@ local spy = require "luassert.spy" local mock = require "luassert.mock" local spawn = require "nvim-lsp-installer.core.spawn" local Result = require "nvim-lsp-installer.core.result" +local installer = require "nvim-lsp-installer.core.installer" local git = require "nvim-lsp-installer.core.managers.git" local Optional = require "nvim-lsp-installer.core.optional" @@ -21,7 +22,9 @@ describe("git manager", function() "should fail if no git repo provided", async_test(function() local err = assert.has_errors(function() - git.clone {}(ctx) + installer.run_installer(ctx, function() + git.clone {} + end) end) assert.equals("No git URL provided.", err) assert.spy(ctx.spawn.git).was_not_called() @@ -31,7 +34,9 @@ describe("git manager", function() it( "should clone provided repo", async_test(function() - git.clone { "https://github.com/williamboman/nvim-lsp-installer.git" }(ctx) + installer.run_installer(ctx, function() + git.clone { "https://github.com/williamboman/nvim-lsp-installer.git" } + end) assert.spy(ctx.spawn.git).was_called(1) assert.spy(ctx.spawn.git).was_called_with { "clone", @@ -47,7 +52,9 @@ describe("git manager", function() "should fetch and checkout revision if requested", async_test(function() ctx.requested_version = Optional.of "1337" - git.clone { "https://github.com/williamboman/nvim-lsp-installer.git" }(ctx) + installer.run_installer(ctx, function() + git.clone { "https://github.com/williamboman/nvim-lsp-installer.git" } + end) assert.spy(ctx.spawn.git).was_called(3) assert.spy(ctx.spawn.git).was_called_with { "clone", @@ -70,7 +77,9 @@ describe("git manager", function() it( "should provide receipt information", async_test(function() - git.clone { "https://github.com/williamboman/nvim-lsp-installer.git" }(ctx) + installer.run_installer(ctx, function() + git.clone({ "https://github.com/williamboman/nvim-lsp-installer.git" }).with_receipt() + end) assert.equals( vim.inspect { type = "git", |
