-
-
Notifications
You must be signed in to change notification settings - Fork 682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce assertThatCharSequence
to disambiguate Groovy's GString
#2791
Comments
Hey @scordio, I am looking for an issue for my first contribution . Can you help me here. Can I take on this . |
Hi @techrajdeep, sure, this issue is up for grabs. Anything where you'd need clarification? |
@scordio Could you please assign it to me |
Hey @scordio! Has this issue been fixed? I don't see a PR for it. If this is still up for grabs, I'd like to work on this. |
Sure and thank you, @debanjanc01! |
Hey @scordio is there an existing test case that tests this out as you have mentioned in the example for |
Hey @scordio, the problem with In the test case mentioned, I wanted to know if you have any suggestions to take this forward. This is to understand your preferences and weigh out the different options before proceeding. |
Thanks for looking into this, @debanjanc01! I see the problem, let me think about it and I'll get back to you. |
Hey @scordio , wanted to check if you've had the time to look into this. |
Hi @debanjanc01, thanks for the ping and apologies for the terribly late feedback 😅
There is no existing test case at the moment and
After checking the topic again and looking at the Groovy sources, the test case I mentioned was definitely wrong. Instead, we should probably target something like the following: @Test
void should_accept_interpolated_expressions() {
// GIVEN
def foo = "foo"
def actual = /.*${foo}.*/
// WHEN/THEN
assertThatCharSequence(actual).isEqualTo(/.*${foo}.*/)
} I would still delegate to Would you still have time to pursue this topic? Otherwise, I'm happy to take it over. |
Hey @scordio thanks for taking the time out to revisit this. Let me check this and get back. |
Feature summary
Currently, Groovy's interpolated expressions cannot be a direct input of
assertThat
asgroovy.lang.GString
implements bothComparable
andCharSequence
.We might add
assertThatCharSequence(CharSequence)
/assumeThatCharSequence(CharSequence)
and the corresponding BDD variants to disambiguate these calls.Example
This should compile:
Implementation notes:
assertThat(CharSequence)
Java6
classes whenever possible.Assertions_sync
andJava6Assertions_sync
can help figure out where the gaps are.Workaround
Use
toString
:The text was updated successfully, but these errors were encountered: