Skip to content

test: avoid stubbing ENV in case-insensitive lookup test - #675

Merged
koic merged 1 commit into
modelcontextprotocol:mainfrom
atesgoral:test/windows-environment-lookup
Nov 12, 2026
Merged

koic merged 1 commit into
modelcontextprotocol:mainfrom
atesgoral:test/windows-environment-lookup

Conversation

@atesgoral

Copy link
Copy Markdown
Contributor

Replace the ENV stubs in the case-insensitive lookup test with a temporary environment Hash.

Motivation and Context

Stubbing ENV raises Ractor::IsolationError on Ruby head. Use a temporary Stdio::ENV constant instead. The Hash retains the mixed-case Path name and accepts case-insensitive lookups, so the test still checks that the child receives PATH. Remove the constant in ensure.

Only this test changes. Production code and the assertion are unchanged.

How Has This Been Tested?

On Ruby 4.0.7, with MT_NO_PLUGINS=1 and the direct-Ruby test harness:

  • The changed test passes: 1 test, 1 assertion.
  • stdio_environment_test.rb and stdio_test.rb pass: 69 tests, 290 assertions.
  • The full suite passes: 2,587 tests, 8,821 assertions, no failures, errors or skips.
  • RuboCop with --force-exclusion passes for the changed file.
  • An in-memory change to use ENV.to_h.slice makes the same assertion fail with PATH missing. This confirms that the test still catches case-sensitive filtering.

Ruby head was not run locally because no head build is installed. The CI matrix runs it.

Breaking Changes

None.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

@koic
koic merged commit 83b06e1 into modelcontextprotocol:main Nov 12, 2026
13 checks passed
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.

2 participants