Skip to content

Fix invalid new() syntax in TestItemParse spec - #10295

Closed
scottsheppeard wants to merge 1 commit into
PathOfBuildingCommunity:devfrom
scottsheppeard:fix-testitemparse-new-syntax
Closed

Fix invalid new() syntax in TestItemParse spec#10295
scottsheppeard wants to merge 1 commit into
PathOfBuildingCommunity:devfrom
scottsheppeard:fix-testitemparse-new-syntax

Conversation

@scottsheppeard

Copy link
Copy Markdown

Description of the problem being solved

The "does not scale modifiers that grant skills" test added in #10174 constructs its item with new("Item", [[...]]), but new() forbids constructor arguments — Modules/Common.lua raises "Extra argument passed to new() during creation of class Item" — so the test errors instead of running:

Error -> ../spec/System/TestItemParse_spec.lua @ 1361
TestAdvancedItemParse #item mod magnitude scaling does not scale modifiers that grant skills
Modules/Common.lua:163: Extra argument passed to new() during creation of class Item. Extra arguments are not allowed.

This changes it to the new("Item"):Item([[...]]) form used by every other test in the file. The test's assertions all pass once it actually runs.

Steps taken to verify a working solution

Ran busted --lua=luajit -p TestItemParse_spec.lua: previously 87 successes / 1 error, now 88 successes / 0 errors. Full suite: 572 successes / 0 failures / 0 errors.

🤖 Generated with Claude Code

The "does not scale modifiers that grant skills" test added in PathOfBuildingCommunity#10174
constructs its item with new("Item", [[...]]), but new() forbids
constructor arguments (Modules/Common.lua raises "Extra argument passed
to new()"), so the test errors instead of running. Use the
new("Item"):Item([[...]]) form like every other test in this file.

The test itself passes once it actually runs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mcagnion

mcagnion commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Duplicate with #10288

@LocalIdentity

Copy link
Copy Markdown
Contributor

#10288 merged that fixes this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants