Closed exterm closed 3 years ago
https://github.com/Shopify/packwerk/issues/136 brought up a possible issue with a constant that is used as a namespace but also defined in its own file:
# sales.rb module Sales end
# sales/entry.rb module Sales class Entry end end
In this case the Sales constant is technically defined in both places, but we want to infer the more specific sales.rb as its location.
Sales
sales.rb
This test proves constant_resolver is doing the right thing in this case.
constant_resolver
https://github.com/Shopify/packwerk/issues/136 brought up a possible issue with a constant that is used as a namespace but also defined in its own file:
In this case the
Sales
constant is technically defined in both places, but we want to infer the more specificsales.rb
as its location.This test proves
constant_resolver
is doing the right thing in this case.