you can use anchors to match the beginning and the end of the string:

```ruby
assert_failure(/\AExpected at least 1 element matching \"p\", found 0\.\z/)
```