-
Notifications
You must be signed in to change notification settings - Fork 466
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
Class literals are not properly rendered (or rendered at all) #909
Comments
Hm, comparing the class attributes is not really helpful here. IMHO we should special case the handling of classes and just compare |
I guess that would be ok too. |
Well, there is one use case where it is probably helpful. |
It was quite easy to fix the rendering of the Class instances (see PR above). However, there are issues when trying to record ClassLiterals, e.g. |
I took a stab at this and fixed it. :-) In my local code now:
What do you think about it? |
@leonard84 Shouldn't this be closed as it was fixed by #910? |
#910 is only a partial fix, or rather no real fix at all. It changes how the class instances are rendered, but does not change at all what I describe here |
Btw. here you can have a look at the current state and how it changes existing test expectations. All pre-existing tests are green in this commit: Vampire@wip |
I added some inline comments, looks good so far. Maybe you also want to tackle the problem @szpak mentioned here #910 (comment) |
Thanks for having a look and confirming I'm on a good path. :-) I pushed a new version that has the Otherwise it is really hard to get helpful information e. g. if you have then:
CompletionException ce = thrown()
with(ce.cause) {
it
it.getClass() == NotFoundException
} and the cause is not what you expect. You only get the name and message. Now you also get the stacktrace. This really bugged me in the last days where I then always had to add then:
CompletionException ce = thrown()
ce.cause
when:
throw ce.cause
then:
NotFoundException nfe = thrown() |
Issue description
If you test classes with class literals, they are not rendered correctly, neither in the normal failure output, nor if you click on
Click to see differences
in IntelliJ IDEA.How to reproduce
Expected behavior
All works like in
both are rendered
.Actual behavior
both are rendered
only expected is rendered
only actual is rendered
none is rendered
Additional Environment information
Java/JDK
1.8.0_131
Groovy version
2.4.9
Build tool version
Gradle 4.8.1
Operating System
Windows 10
IDE
IntelliJ IDEA 2018.1.6
Build-tool dependencies used
testImplementation 'org.spockframework:spock-core:1.2-RC2-groovy-2.4'
The text was updated successfully, but these errors were encountered: