Skip to content

Refactor code duplication in test support utilities #63

@coderabbitai

Description

@coderabbitai

Problem

CodeScene analysis has identified code duplication between two functions in tests/support/mod.rs:

  • fake_ninja
  • fake_ninja_pwd

Both functions follow a similar pattern for creating fake executables with temporary directories and shell scripts, but with different script content.

Suggested Solution

Consider extracting the common functionality into a shared helper function that accepts the script content as a parameter, reducing duplication whilst maintaining the specific behaviour of each function.

Context

This issue was identified during PR review and flagged by automated analysis.

References:

Requested by: @leynos

Metadata

Metadata

Assignees

Labels

lowAin't annoying anyone but the QA department

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions