Skip to content

Avoid polluting global namespace in TypesExplainer tests#1650

Open
Bo98 wants to merge 1 commit intolsegal:mainfrom
Bo98:types-explainer-spec-fix
Open

Avoid polluting global namespace in TypesExplainer tests#1650
Bo98 wants to merge 1 commit intolsegal:mainfrom
Bo98:types-explainer-spec-fix

Conversation

@Bo98
Copy link

@Bo98 Bo98 commented Mar 5, 2026

Description

Setting constants in a spec does not limit it to that spec - it will pollute the global namespace and bleed over to other tests.

In Ruby 4.0, this issue becomes apparent as it breaks different tests with:

uninitialized constant YARD::Tags::TypesExplainer::Parser::Ruby

You could fix this elsewhere by fully qualifying any reference to Parser but the real underlying problem here is the namespace pollution.

Completed Tasks

  • I have read the Contributing Guide.
  • The pull request is complete (implemented / written).
  • Git commits have been cleaned up (squash WIP / revert commits).
  • I wrote tests and ran bundle exec rake locally (if code is attached to PR).

@Bo98 Bo98 mentioned this pull request Mar 5, 2026
4 tasks
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.

1 participant