Open
Description
If the title is too hard to understand, please take a look at this example.
expect('<div><p>test</p></div><div><h2>test2</h2></div>').to have_tag('div') do
with_tag 'p'
with_tag 'h2'
end
The string consists of 2 div
s, where one has a p
tag and the other one has a h2
tag.
Intuitively, I would expect the expectation to fail because the string does not have a div
tag with tags p
and h2
.
However, it does not fail.
It would be great if there was an option to require all nested matchers to be true for a single element of the outer scope instead of being true for any element of the outer scope.
I might try to implement it myself and create a pull request.
Metadata
Metadata
Assignees
Labels
No labels