Commit 1f1df71
committed
selector_assertions/html_selector: No trailing
- I was refreshing my Rails knowledge by following a Rails tutorial
(but with the latest gem versions) and I found that when I used
`assert_select` and it failed, the message was printed like:
```
1) Failure:
StaticPagesControllerTest#test_should_get_about [/Users/issyl0/repos/issyl0/rails-tutorial/sample_app/test/controllers/static_pages_controller_test.rb:24]:
<About | Ruby on Rails Tutorial Sample App> expected but was
<About| Ruby on Rails Tutorial Sample App>..
Expected 0 to be >= 1.
```
- That is, the "expected but was" sentence ends with two periods.
There's an example of this output in the [release notes for Rails 4.2
about `assert_select` behaviour
changes](https://edgeguides.rubyonrails.org/4_2_release_notes.html#assert-select),
so it's pretty old. But even so, the two periods to end the sentence
looked weird to me.
- I did look at the MiniTest code to see if I could upstream this
further (`if message.end_with?(".")` then don't add another period, or
something), but I couldn't find the place to do it and I was also
surprised that someone else hadn't noticed this before, so I thought I'd
leave that alone as there are probably reasons that are way beyond my
levels of understanding of the interactions between MiniTest's core
functionality vs. this gem!. on content_mismatch
1 parent 267b117 commit 1f1df71
File tree
1 file changed
+1
-1
lines changed- lib/rails/dom/testing/assertions/selector_assertions
1 file changed
+1
-1
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
0 commit comments