aboutsummaryrefslogtreecommitdiffstats
path: root/tests/mason-core/fetch_spec.lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2023-06-21 18:42:34 +0200
committerGitHub <noreply@github.com>2023-06-21 18:42:34 +0200
commite706d305fbcc8701bd30e31dd727aee2853b9db9 (patch)
tree7baf556871a7737b4a01abdc05a1d6e8f8fa5ea7 /tests/mason-core/fetch_spec.lua
parentchore(main): release 1.3.0 (#1359) (diff)
downloadmason-e706d305fbcc8701bd30e31dd727aee2853b9db9.tar
mason-e706d305fbcc8701bd30e31dd727aee2853b9db9.tar.gz
mason-e706d305fbcc8701bd30e31dd727aee2853b9db9.tar.bz2
mason-e706d305fbcc8701bd30e31dd727aee2853b9db9.tar.lz
mason-e706d305fbcc8701bd30e31dd727aee2853b9db9.tar.xz
mason-e706d305fbcc8701bd30e31dd727aee2853b9db9.tar.zst
mason-e706d305fbcc8701bd30e31dd727aee2853b9db9.zip
feat(fetch): include mason.nvim version in User-Agent (#1362)
Diffstat (limited to 'tests/mason-core/fetch_spec.lua')
-rw-r--r--tests/mason-core/fetch_spec.lua17
1 files changed, 13 insertions, 4 deletions
diff --git a/tests/mason-core/fetch_spec.lua b/tests/mason-core/fetch_spec.lua
index 7a25a693..39351abe 100644
--- a/tests/mason-core/fetch_spec.lua
+++ b/tests/mason-core/fetch_spec.lua
@@ -3,6 +3,7 @@ local fetch = require "mason-core.fetch"
local match = require "luassert.match"
local spawn = require "mason-core.spawn"
local stub = require "luassert.stub"
+local version = require "mason.version"
describe("fetch", function()
it(
@@ -21,7 +22,9 @@ describe("fetch", function()
assert.spy(spawn.curl).was_called(1)
assert.spy(spawn.wget).was_called_with {
{
- "--header=User-Agent: mason.nvim (+https://github.com/williamboman/mason.nvim)",
+ ("--header=User-Agent: mason.nvim %s (+https://github.com/williamboman/mason.nvim)"):format(
+ version.VERSION
+ ),
"--header=X-Custom-Header: here",
},
"-nv",
@@ -38,7 +41,9 @@ describe("fetch", function()
match.same {
{
"-H",
- "User-Agent: mason.nvim (+https://github.com/williamboman/mason.nvim)",
+ ("User-Agent: mason.nvim %s (+https://github.com/williamboman/mason.nvim)"):format(
+ version.VERSION
+ ),
},
{
"-H",
@@ -79,7 +84,9 @@ describe("fetch", function()
assert.spy(spawn.wget).was_called_with {
{
- "--header=User-Agent: mason.nvim (+https://github.com/williamboman/mason.nvim)",
+ ("--header=User-Agent: mason.nvim %s (+https://github.com/williamboman/mason.nvim)"):format(
+ version.VERSION
+ ),
},
"-nv",
"-o",
@@ -95,7 +102,9 @@ describe("fetch", function()
match.same {
{
"-H",
- "User-Agent: mason.nvim (+https://github.com/williamboman/mason.nvim)",
+ ("User-Agent: mason.nvim %s (+https://github.com/williamboman/mason.nvim)"):format(
+ version.VERSION
+ ),
},
},
"-fsSL",