Skip to content

--no-canonicalize does not seem to work in rspec #7

Open

Description

@weshatheleopard

Looks like respective branches only fire in new minitest, old minitest and test_unit, but not in rspec.

Activity

  1. smetana commented on Mar 16, 2023

    @smetana
    Contributor

    Hi. Thank you for report. We'll take a look at the issue

  2. weshatheleopard commented on Mar 16, 2023

    @weshatheleopard
    ContributorAuthor

    The situation that brought this issue into existance is that we utilize rspec, and we are using assert_value to compare an HTML file produced by the code with a sample HTML file. Whenever a special HTML character was encoded in the said HTML file (for example, {), everything else on that line would be stripped by the canonicalizer (because of #). As a result, if something important has changed in the produced HTML beyond that character, assert-value would fail to notice the discrepancy. Learned it the hard way.

    What we would like:
    a) capability to disable canonicalization when using rspec (as specified above, right now such capability is completely missing).
    b) capability to do so through the code (like, spec_helper.rb, etc/intializers/assert_value.rb or the like) instead of through the commandline option.

  3. smetana commented on Mar 20, 2023

    @smetana
    Contributor

    We agree with your analysis. We probably will not have time to work on this in the immediate future. PR would be welcomed if you want to work on this.

  4. weshatheleopard commented on Mar 20, 2023

    @weshatheleopard
    ContributorAuthor

    The reason I brought this to your attention is because there are multiple possible ways to accomplish that (like, how whether to have a global configuration variable set by spec_helper, an initializer, etc, etc, and I wanted to let you choose the exact path. If you are giving that choice to me, I can certainly do that.

  5. smetana commented on Mar 21, 2023

    @smetana
    Contributor

    Yes please. It will make sense to have two PRs.

    One for RSpec support. Will need to make sure it passes tests in different ruby versions (see test matrix).

    And one for controlling canonicalization. This may require more discussion, but ideally we should do that after you have a PR with approach you like best.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions