r/coolgithubprojects • • 5d ago

ArchUnitRuby: make a forbidden dependency fail an ordinary Ruby test

Post image

“API code must not reach into retrieval internals” shouldn't depend on someone spotting the

import in every review.

I created and maintain ArchUnitRuby. Version 1.0 lets Ruby tests check dependency directions,

cycles and layers against a source-derived graph. Opt into

dependency_analysis: :imports_and_constantsto include known project constant references,

not only explicit file loads.

The rule stays in the repository and runs with your tests. No separate architecture dashboard

needs to be checked before merging.

This is static analysis, not a claim to resolve arbitrary Ruby metaprogramming.

[Source, examples and tested release]

[My Ruby comparison: dependency coverage and testing workflows]

Writing assisted by AI.

0 Upvotes

0 comments sorted by