You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pairwise comparison verifies that every adjacent pair of classes in a
list agree with each other, which works well when all classes are peers
with no single authoritative definition. Canonical interface comparison
takes a different approach: one class is designated as the reference,
and every other class is checked against it directly. This is useful
when the interface already has a clear owner — an abstract base, a
well-established implementation, or a purpose-built interface class —
and you want to confirm that all other implementations conform to that
definition. Because all comparisons share the same right-hand side,
failures from multiple classes are aggregated into a single result,
making it easier to see the full picture at a glance.
- Adds `CanonicalInterfaceChecker`, which compares every class in a list
against a single canonical reference rather than in consecutive pairs.
All failures are aggregated into one result, so a single assertion
reports every non-conforming class at once.
- Exposes `assert_canonical_interface_match(canonical, objects, **opts)`
in the Minitest integration and
`implement_canonical_interface(canonical, **opts)` in the RSpec
integration. All existing options (`type:`, `methods:`, `strict:`,
`name:`, `namespace:`) are supported.
- Extracts shared checker initialization (argument validation, object
resolution, name inference, checker construction) into
`InterfaceSetup`, eliminating duplication between
`BulkInterfaceChecker` and `CanonicalInterfaceChecker`.
0 commit comments