Forgus / spock

Automatically exported from code.google.com/p/spock
0 stars 0 forks source link

BUG! exception in phase 'semantic analysis'... object is not an instance of declaring class... #327

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I'm getting this error for a trivial test:

Error Compilation error compiling [unit] tests: BUG! exception in phase 
'semantic analysis' in source unit 
'/vagrant/myapp/test/unit/myapp/SomethingSpec.groovy' object is not an instance 
of declaring class...

CODE:

package myapp

import grails.test.mixin.TestFor
import spock.lang.Specification

/**
 * See the API for {@link grails.test.mixin.domain.DomainClassUnitTestMixin} for usage instructions
 */
@TestFor(Something)
class SomethingSpec extends Specification {

    def setup() {
    }

    def cleanup() {
    }

    void "test something"() {
        expect:
        false
    }
}

ISSUE:

grails> test-app :spock
| Compiling 1 source files.
| Error Compilation error compiling [unit] tests: BUG! exception in phase 
'semantic analysis' in source unit 
'/vagrant/myapp/test/unit/myapp/SomethingSpec.groovy' object is not an instance 
of declaring class 

## What version of Spock and Groovy are you using?

Spock 0.7 and Groovy Version: 2.1.6 JVM: 1.6.0_27

Why in the name of the goats this test fails?!

Thanks in advance!

Original issue reported on code.google.com by mont...@gmail.com on 28 Aug 2013 at 8:13

GoogleCodeExporter commented 8 years ago
To determine what's causing this, we'll need at least the full stack trace, or 
better, a self-contained reproducible example. What's your exact spock-grails 
setup? Which versions of spock-grails and Grails are you using?

Original comment by pnied...@gmail.com on 28 Aug 2013 at 9:23

GoogleCodeExporter commented 8 years ago
Now it magically works. I can't reproduce the error... =S

Original comment by mont...@gmail.com on 30 Aug 2013 at 8:02