Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: re-expose GTIN#check_digit as public method #28

Merged
merged 1 commit into from
Aug 30, 2022

Commits on Mar 10, 2022

  1. Fix: re-expose GTIN#check_digit

    PR marketplacer#3 changed the internals of BarcodeValidation::GTIN to support
    different GTIN formats and to allow conversion between them. While this is
    a _very_ nice feature, it unfortunately made the previously public method
    `GTIN#check_digit` (which was added via BarcodeValidation::Mixin) private.
    
    In v2.2.0 we relied on this in our tests to fix the check digit of randomly
    generated barcodes. v2.3.0 makes both `check_digit` and `expected_check_digit`
    private, so it does not publicly expose any of the tools we'd need for
    our purposes.
    
    The simplest fix seemed to make `check_digit` public, which restores the
    API that was available in v2.2.0. I've added a spec that calls the
    method and its validation as a means to ensure it remains public.
    
    Ref: marketplacer#3
    Narnach committed Mar 10, 2022
    Configuration menu
    Copy the full SHA
    8d74c4f View commit details
    Browse the repository at this point in the history