Fix invalid new() syntax in TestItemParse spec - #10295
Closed
scottsheppeard wants to merge 1 commit into
Closed
Conversation
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>
Contributor
|
Duplicate with #10288 |
Contributor
|
#10288 merged that fixes this issue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the problem being solved
The "does not scale modifiers that grant skills" test added in #10174 constructs its item with
new("Item", [[...]]), butnew()forbids constructor arguments —Modules/Common.luaraises "Extra argument passed to new() during creation of class Item" — so the test errors instead of running: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