Skip to content

Conversation

@rajaravivarma-r
Copy link

  • The have_child_tag can be used to match any child or grand child tags.
  • Does not alter any existing matchers' behaviour.

TODO: Documentation pending.

@rajaravivarma-r
Copy link
Author

@kucaahbe This PR addresses this issue #65 and possibly an alternative approach to this issue #76 too.

The idea is to match child elements strictly, and not match against the parent tag, which is the current behaviour. Right now, I've added have_child_tag matcher which will match against any child or grand child.

Later we can add have_direct_child_tag matcher, to match against any direct child as well.

Please let me know if this is something you want to proceed with, I'm happy to polish this and add documentation.

@kucaahbe
Copy link
Owner

Hello @rajaravivarma-r, thank you for your efforts in addressing these long-term issues.

To be clear, I don't have much time to work on this project because of the war in my country (🇺🇦), so I'm trying to be both practical and pragmatic in decision-making. Additionally, this project began more than 10 years ago, and I haven't worked on it for at least 7 years, so my understanding of how it works and how it was intended to work is limited.
With that in mind, let's see what we have:

Both issues (#65/#76) signal a severe bug in with_tag matcher, which, on one side, requires potentially a big rewrite, on the other side, your approach in a backwards-compatible way fixes the issue for people. So let's go for it.

The only thing missing (which you stated in PR description) is the documentation, so I suggest adding one in a way that not only documents the behaviour of the have_child_tag matcher, but also highlights the principal difference with with_tag, so people don't confuse them.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants