Migrate safe navigation tests from Rust to Ruby#68
Merged
Conversation
The 4 safe_navigation tests in dispatch.rs were full-pipeline tests (parse → install → propagate → run_all) that duplicated what Ruby integration tests verify end-to-end. Replace them with equivalent Ruby tests in test/safe_navigation_test.rb and remove the redundant Rust tests to reduce test code bloat in dispatch.rs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2f2780e to
196600a
Compare
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.
Motivation
The 4 safe_navigation tests in
dispatch.rsfollowed theanalyze() → resolve_method() → type string comparisonpattern, making them effectively integration tests. These are better served by Ruby integration tests that verify end-to-end CLI behavior. This reduces test code bloat indispatch.rs(which is 74% test code) while maintaining equivalent coverage.Changes
test/safe_navigation_test.rbwith 4 Ruby integration tests covering safe navigation operator scenarios (obj&.name,nil&.foo, chained&., and undefined method detection)core/src/analyzer/dispatch.rsChecked
cd core && cargo test --libpasses (safe_navigation Rust tests removed)bundle exec rake testpasses (new Ruby tests intest/safe_navigation_test.rb)🤖 Generated with Claude Code