These are chat archives for etorreborre/specs2

13th
Nov 2017
Edmondo Porcu
@edmondo1984
Nov 13 2017 09:25
Hello, is there a simple way to debug beEqualTo failures with case classes?
it is a pain when the case class is very complex and with nested case classes
Eric Torreborre
@etorreborre
Nov 13 2017 09:56
Did you try the CaseClassDiff support? https://etorreborre.github.io/specs2/guide/SPECS2-4.0.1/org.specs2.guide.DiffableTypeclass.html and import org.specs2.matcher.CaseClassDiffs._
Andreas Flierl
@asflierl
Nov 13 2017 10:31
Eric, I created the most minimal project I could think of that I think should produce a HTML TOC when running "test" in it: https://github.com/asflierl/specs2-toc
Andreas Flierl
@asflierl
Nov 13 2017 10:40
but it's not generating the TOC. the <toc/> placeholder tag is in the HTML, so the flag itself works - something going on with replacing that tag with the actual TOC
Eric Torreborre
@etorreborre
Nov 13 2017 10:42
You need to add the all argument. I think that the toc is generated and inserted only when you generate the spec having references to other specs. all enables the execution and reporting of all the other specs. So in general, you should only use all for a given spec which is the root of your documentation
Sorry this is not something which is explained well in the docs
Andreas Flierl
@asflierl
Nov 13 2017 11:25
Thanks. That is what I am doing in my real projects - to no avail. I updated the example project with a root spec and added the "all" argument. Still no TOC though. Anyway, thanks for your time! I'll figure it out at some point.
Eric Torreborre
@etorreborre
Nov 13 2017 12:15
I do get a toc with your example
it just displays a bit weirdly
Andreas Flierl
@asflierl
Nov 13 2017 14:19
now that is really weird. neither on the Windows machine, nor on the Jenkins build server (running Linux) nor on the Mac at home do I get a TOC with that project.
Eric Torreborre
@etorreborre
Nov 13 2017 15:14
really weird indeed, I'm afraid there's an exception somewhere that must be swallowed and hiding the underlying issue. Your last option is to use intellij and use the debugger to see what's happening in the TableOfContents class
Andreas Flierl
@asflierl
Nov 13 2017 15:36
I'll give that a try
Andreas Flierl
@asflierl
Nov 13 2017 16:39
found at least an issue with a hardcoded file separator "/" which causes some problems on Windows... I'll investigate a bit further what's going on on the other OS's and probably make a pull request later this week
Andreas Flierl
@asflierl
Nov 13 2017 19:06
ah yes. with the "all" argument it works with *nix systems. so it's pretty much just the file separator issue.