Debugging Spock tests in Eclipse

952 views
Skip to first unread message

Jeff Sussna

unread,
Aug 28, 2012, 2:11:48 PM8/28/12
to spockfr...@googlegroups.com
I find I have to be very careful about where I set breakpoints when debugging Spock tests in Eclipse. Generally, if I don't set an initial breakpoint in a given clause, no subsequent breakpoints get hit. Also, even when I do, subsequent breakpoints sometimes get skipped. Anyone else having the same problem?

I should note that I'm using Geb, so instantiating GebSpec which is a subclass of Specification, in case that matters.

Eclipse 3.6.2
Spock 0.6
Groovy 1.8.6
Geb 0.7.0


Peter Niederwieser

unread,
Aug 28, 2012, 2:58:50 PM8/28/12
to spockfr...@googlegroups.com
I recommend to bring this up on the Groovy Eclipse list.

Cheers,
Peter

--
You received this message because you are subscribed to the Google Groups "Spock Framework - User" group.
To view this discussion on the web visit https://groups.google.com/d/msg/spockframework/-/-57cizhZ6oIJ.
To post to this group, send email to spockfr...@googlegroups.com.
To unsubscribe from this group, send email to spockframewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/spockframework?hl=en.

Jeff Sussna

unread,
Aug 28, 2012, 3:59:34 PM8/28/12
to spockfr...@googlegroups.com
OK. Raised it here since AFAIK I haven't had this problem with generic Groovy code.

Jan Bols

unread,
Aug 28, 2012, 4:14:32 PM8/28/12
to spockfr...@googlegroups.com
Hi Jeff,
indeed you should put your breakpoints in the when-clause because they get
skipped in the then-clause. At least they do on my machine and I'm using
intellij. I guess it must have something to do with the way the
then-clause is executed before the when-clause, but I'm sure someone else
should give you a proper explanation on why this is.

regards
Jan

Op Tue, 28 Aug 2012 20:11:48 +0200 schreef Jeff Sussna
<j...@ingineering.it>:

Peter Niederwieser

unread,
Aug 28, 2012, 4:30:16 PM8/28/12
to spockfr...@googlegroups.com

On Aug 28, 2012, at 10:14 PM, "Jan Bols" <guter...@gmail.com> wrote:

> Hi Jeff,
> indeed you should put your breakpoints in the when-clause because they get skipped in the then-clause. At least they do on my machine and I'm using intellij. I guess it must have something to do with the way the then-clause is executed before the when-clause, but I'm sure someone else should give you a proper explanation on why this is.

First time I hear about this, but I can't make breakpoints in then-blocks work either (in IntelliJ). Certainly worth a Spock issue. As for Eclipse, from my personal experience it has some problems with AST transforms, which are employed heavily by Spock.

Cheers,
Peter

Reply all
Reply to author
Forward
0 new messages