From e706d305fbcc8701bd30e31dd727aee2853b9db9 Mon Sep 17 00:00:00 2001 From: William Boman Date: Wed, 21 Jun 2023 18:42:34 +0200 Subject: feat(fetch): include mason.nvim version in User-Agent (#1362) --- tests/mason-core/fetch_spec.lua | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'tests/mason-core/fetch_spec.lua') 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", -- cgit v1.2.3-70-g09d2