Skip to content

Migrate safe navigation tests from Rust to Ruby#68

Merged
dak2 merged 1 commit intomainfrom
migrate-safe-navigation-tests-to-ruby
Mar 20, 2026
Merged

Migrate safe navigation tests from Rust to Ruby#68
dak2 merged 1 commit intomainfrom
migrate-safe-navigation-tests-to-ruby

Conversation

@dak2
Copy link
Copy Markdown
Owner

@dak2 dak2 commented Mar 20, 2026

Motivation

The 4 safe_navigation tests in dispatch.rs followed the analyze() → resolve_method() → type string comparison pattern, 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 in dispatch.rs (which is 74% test code) while maintaining equivalent coverage.

Changes

  • Add test/safe_navigation_test.rb with 4 Ruby integration tests covering safe navigation operator scenarios (obj&.name, nil&.foo, chained &., and undefined method detection)
  • Remove 4 redundant safe_navigation tests from core/src/analyzer/dispatch.rs

Checked

  • cd core && cargo test --lib passes (safe_navigation Rust tests removed)
  • bundle exec rake test passes (new Ruby tests in test/safe_navigation_test.rb)

🤖 Generated with Claude Code

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>
@dak2 dak2 force-pushed the migrate-safe-navigation-tests-to-ruby branch from 2f2780e to 196600a Compare March 20, 2026 08:14
@dak2 dak2 merged commit 6177e41 into main Mar 20, 2026
4 checks passed
@dak2 dak2 deleted the migrate-safe-navigation-tests-to-ruby branch March 20, 2026 08:18
@dak2 dak2 mentioned this pull request Mar 24, 2026
2 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