diff options
| author | William Boman <william@redwill.se> | 2023-04-05 19:50:43 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-05 19:50:43 +0200 |
| commit | e57d9bd671adce24970480a194690d207e2a141d (patch) | |
| tree | 238431a4bf3ba863dd658cd40f77834af241731e /tests | |
| parent | fix(npm): set install-strategy on npm >= 9 (#1179) (diff) | |
| download | mason-e57d9bd671adce24970480a194690d207e2a141d.tar mason-e57d9bd671adce24970480a194690d207e2a141d.tar.gz mason-e57d9bd671adce24970480a194690d207e2a141d.tar.bz2 mason-e57d9bd671adce24970480a194690d207e2a141d.tar.lz mason-e57d9bd671adce24970480a194690d207e2a141d.tar.xz mason-e57d9bd671adce24970480a194690d207e2a141d.tar.zst mason-e57d9bd671adce24970480a194690d207e2a141d.zip | |
fix(github): fall back to curl/wget if gh is not available (#1181)
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/mason-core/managers/github_spec.lua | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/tests/mason-core/managers/github_spec.lua b/tests/mason-core/managers/github_spec.lua index b4ef3c42..d0a88faa 100644 --- a/tests/mason-core/managers/github_spec.lua +++ b/tests/mason-core/managers/github_spec.lua @@ -3,15 +3,15 @@ local stub = require "luassert.stub" local Optional = require "mason-core.optional" local Result = require "mason-core.result" -local client = require "mason-core.managers.github.client" local github = require "mason-core.managers.github" local installer = require "mason-core.installer" +local providers = require "mason-core.providers" describe("github release file", function() it( "should use provided version", async_test(function() - stub(client, "fetch_latest_release") + stub(providers.github, "get_latest_release") local handle = InstallHandleGenerator "dummy" local ctx = InstallContextGenerator(handle) installer.prepare_installer(ctx) @@ -22,7 +22,7 @@ describe("github release file", function() version = Optional.of "13.37", } end) - assert.spy(client.fetch_latest_release).was_not_called() + assert.spy(providers.github.get_latest_release).was_not_called() assert.equals("13.37", source.release) assert.equals( "https://github.com/williamboman/mason.nvim/releases/download/13.37/program.exe", @@ -34,8 +34,8 @@ describe("github release file", function() it( "should use use dynamic asset_file", async_test(function() - stub(client, "fetch_latest_release") - client.fetch_latest_release.returns(Result.success(mock.new { + stub(providers.github, "get_latest_release") + providers.github.get_latest_release.returns(Result.success(mock.new { tag_name = "im_the_tag", })) local handle = InstallHandleGenerator "dummy" @@ -49,8 +49,8 @@ describe("github release file", function() end, } end) - assert.spy(client.fetch_latest_release).was_called(1) - assert.spy(client.fetch_latest_release).was_called_with "williamboman/mason.nvim" + assert.spy(providers.github.get_latest_release).was_called(1) + assert.spy(providers.github.get_latest_release).was_called_with "williamboman/mason.nvim" assert.equals("im_the_tag", source.release) assert.equals("im_the_tag_for_reals", source.asset_file) assert.equals( @@ -65,7 +65,7 @@ describe("github release version", function() it( "should use provided version", async_test(function() - stub(client, "fetch_latest_release") + stub(providers.github, "get_latest_release") local handle = InstallHandleGenerator "dummy" local ctx = InstallContextGenerator(handle) installer.prepare_installer(ctx) @@ -75,7 +75,7 @@ describe("github release version", function() version = Optional.of "13.37", } end) - assert.spy(client.fetch_latest_release).was_not_called() + assert.spy(providers.github.get_latest_release).was_not_called() assert.equals("13.37", source.release) end) ) @@ -84,8 +84,8 @@ describe("github release version", function() "should fetch latest release from GitHub API", async_test(function() async_test(function() - stub(client, "fetch_latest_release") - client.fetch_latest_release.returns(Result.success { tag_name = "v42" }) + stub(providers.github, "get_latest_release") + providers.github.get_latest_release.returns(Result.success { tag_name = "v42" }) local handle = InstallHandleGenerator "dummy" local ctx = InstallContextGenerator(handle) installer.prepare_installer(ctx) @@ -94,8 +94,8 @@ describe("github release version", function() repo = "williamboman/mason.nvim", } end) - assert.spy(client.fetch_latest_release).was_called(1) - assert.spy(client.fetch_latest_release).was_called_with "williamboman/mason.nvim" + assert.spy(providers.github.get_latest_release).was_called(1) + assert.spy(providers.github.get_latest_release).was_called_with "williamboman/mason.nvim" assert.equals("v42", source.release) end) end) |
