aboutsummaryrefslogtreecommitdiffstats
path: root/tests/core/managers/git_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tests/core/managers/git_spec.lua')
-rw-r--r--tests/core/managers/git_spec.lua17
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",