Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions spec/fixtures_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ describe("fixtures:", function()

it("returns the absolute fixture path", function()
local path = fixtures.path("fixtures/myfile.txt")
assert.match("^.-busted[/\\]spec[/\\]fixtures[/\\]myfile.txt$", path)
assert.match("^.-busted[^/\\]*[/\\]spec[/\\]fixtures[/\\]myfile.txt$", path)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this works for your specific case, where you checkout busted in a directory busted-xyz but it is not a generic solution.

This problem exists because you use a non-default git checkout directory. So if we fix it, we should fix it generically, by grabbing the name of the current directory, and injecting that dynamically.

@mcepl mcepl Mar 15, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, the question is, why there is that busted[/] part at all? Why should we be concerned about anything outside of the tarball itself? And by the way, that busted-2.3.0/ is part of your tarball, not something I would invent on my own.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, but that's a different solution, then we should skip the busted or bustedXXX part alltogether.

Something like this? (untested)

Suggested change
assert.match("^.-busted[^/\\]*[/\\]spec[/\\]fixtures[/\\]myfile.txt$", path)
assert.match("^.-[/\\]spec[/\\]fixtures[/\\]myfile.txt$", path)

end)

it("returns the absolute fixture path normalized", function()
local path = fixtures.path("../fixtures/myfile.txt")
assert.match("^.-busted[/\\]fixtures[/\\]myfile.txt$", path)
assert.match("^.-busted[^/\\]*[/\\]fixtures[/\\]myfile.txt$", path)
end)

it("errors on bad input", function()
Expand Down Expand Up @@ -83,4 +83,3 @@ describe("fixtures:", function()


end)

Loading