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
{{ message }}
Repository navigation
--no-canonicalize does not seem to work in rspec #7
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.
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.
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.
Activity
smetana commentedon Mar 16, 2023
Hi. Thank you for report. We'll take a look at the issue
weshatheleopard commentedon Mar 16, 2023
The situation that brought this issue into existance is that we utilize
rspec, and we are usingassert_valueto 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-valuewould 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.rbor the like) instead of through the commandline option.smetana commentedon Mar 20, 2023
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.
weshatheleopard commentedon Mar 20, 2023
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.smetana commentedon Mar 21, 2023
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.