0

I am using the Spockframework/Groovy with eclipse(sts) and frequently run my Specs inside the IDE.

What really annoys me is that when I want to jump to a test method it doesn't work.

Does someone know a workaround for this limitation or an alternative?

GoToTest Not Working

tim_yates
  • 167,322
  • 27
  • 342
  • 338
Vad1mo
  • 5,156
  • 6
  • 36
  • 65

2 Answers2

0

It's a known limitation of the Eclipse JUnit plugin. It can only jump to methods whose name does not contain spaces. There exists a long-standing improvement request to fix this (https://bugs.eclipse.org/bugs/show_bug.cgi?id=343129). Meanwhile, your options are to live with the status quo, to only use method names without spaces (not sure about other special characters), to contribute a fix to Eclipse, or to switch to an IDE that doesn't have this problem (such as IntelliJ IDEA).

Peter Niederwieser
  • 121,412
  • 21
  • 324
  • 259
0

For now, the quick fix will be that you replace the spaces (' ') by an other character such as underscore ('_'). I just did it with two regEx using Eclipse's find and replace.

Step 1. Remove the whites spaces and replace with underscore

Find: (def "\w*)\s+

Replace with: $1_

(optional) Step 2. Remove method double quotes

Find: (def\s+\w*)"

Replace with: $1

Pier
  • 512
  • 4
  • 5