3

I just installed intellij and downloaded the geb-example-grade (https://github.com/geb/geb-example-gradle). In Intellij settings I configured under gradle/runner: Run test using: Let me choose per test. Then I ran the test "can get to the current Book of Geb" with gradle and it worked fine also running the GebishOrgSpec class worked fine. Then I added a single quote to the methodname of the test, i.e. "can ' get to the current Book of Geb". Running the GebishOrgSpec class (containing that test) with gradle still works fine. But when I run the test with gradle (i.e. after Alt-Shift-F10 in the run menu I choose "GebishOrgSpec.can ' get to the current Book of Geb" instaead of "GebishOrgSpec") i get the following error:

FAILURE: Build failed with an exception.
* Where:
Initialization script '/tmp/ijtestinit3.gradle' line: 6
* What went wrong:
Could not compile initialization script '/tmp/ijtestinit3.gradle'.
> startup failed:
  initialization script '/tmp/ijtestinit3.gradle': 6: unexpected token: get @ line 6, column 49.
     ludes = ['GebishOrgSpec.can ' get to the
                                   ^
  1 error
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 0s
Cause: startup failed:
initialization script '/tmp/ijtestinit3.gradle': 6: unexpected token: get @ line 6, column 49.
   ludes = ['GebishOrgSpec.can ' get to the
                                 ^
1 error

I also tried run running the test with Junit (after setting the driver path) that also works fine. For me it makes absolutely no sense that the very same test works when running the class but not when running the method of the class. Here just to be complete also the class code:

import geb.spock.GebSpec
class GebishOrgSpec extends GebSpec {
        def "can ' get to the current Book of Geb"() {
        when:
        to GebishOrgHomePage

        and:
        manualsMenu.open()

        then:
        manualsMenu.links[0].text().startsWith("current")

        when:
        manualsMenu.links[0].click()

        then:
        at TheBookOfGebPage
    }
}

Update: I had this behaviour on two different computers, but i would appreciate if others also test this. It should be fairly easy to reproduce (if there are questions on the description above, let me know.) Maybe u won't have the error and i have some bad configurations or u can confirm this bug and we raise the attention for it.

0 Answers0