Skip to content

Commit

Permalink
Different path in github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
MisanthropicBit committed Feb 8, 2024
1 parent 1e1c458 commit 5d1b58f
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions tests/adapter_build_spec_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@ local stub = require("luassert.stub")
local async = _async.tests

describe("adapter.build_spec", function()
local function assert_spec_command(spec_command, items)
assert.are.same(#spec_command, #items)

local idx = 1

while idx <= #items do
local item = items[idx]
assert.are.same(spec_command[idx], item)
idx = idx + 1

-- Handle a different path when running in github actions
if item == "--output" then
assert.is_true(vim.endswith(spec_command[idx], "lua/neotest-busted/output_handler.lua"))
idx = idx + 1
end
end
end

---@param adapter neotest.Adapter
---@return neotest.Tree
local function create_tree(adapter)
Expand Down Expand Up @@ -41,7 +59,7 @@ describe("adapter.build_spec", function()

assert.is_not_nil(spec)

assert.are.same(spec.command, {
assert_spec_command(spec.command, {
vim.loop.exepath(),
"--headless",
"-i",
Expand Down Expand Up @@ -97,7 +115,7 @@ describe("adapter.build_spec", function()

assert.is_not_nil(spec)

assert.are.same(spec.command, {
assert_spec_command(spec.command, {
vim.loop.exepath(),
"--headless",
"-i",
Expand Down Expand Up @@ -152,7 +170,7 @@ describe("adapter.build_spec", function()

assert.is_not_nil(spec)

assert.are.same(spec.command, {
assert_spec_command(spec.command, {
vim.loop.exepath(),
"--headless",
"-i",
Expand Down Expand Up @@ -199,7 +217,7 @@ describe("adapter.build_spec", function()

assert.is_not_nil(spec)

assert.are.same(spec.command, {
assert_spec_command(spec.command, {
vim.loop.exepath(),
"--headless",
"-i",
Expand Down

0 comments on commit 5d1b58f

Please sign in to comment.