Hi guys, I'm trying to use Spek as test engine for...
# spek
j
Hi guys, I'm trying to use Spek as test engine for my project but unfortunately the setup described in the documentation does not working in my project... My build.gradle file is set up like this:
Copy code
buildscript {
    repositories { mavenCentral() }
    dependencies { classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.0-M3' }
}

plugins {
    id 'application'
    id 'com.heroku.sdk.heroku-gradle' version '0.2.0'
    id 'org.jetbrains.kotlin.jvm' version '1.1.1'
}

apply plugin: 'org.junit.platform.gradle.plugin'

junitPlatform {
    filters {
        engines {
            include 'spek'
        }
    }
}

group 'inteli-technology'
version '1.0'
mainClassName = "Routes"

sourceSets {
    main.kotlin.srcDirs += 'src/main/kotlin'
    test.kotlin.srcDirs += 'src/test/kotlin'

    main.java.srcDirs += 'src/main/kotlin/'
    test.java.srcDirs += 'src/test/kotlin/'
}

repositories {
    jcenter()
    maven { url "<http://dl.bintray.com/jetbrains/spek>" }
}

def kotlin_version = '1.1.1'

dependencies {
    compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
    compile 'com.github.salomonbrys.kodein:kodein:3.2.0'

    compile 'com.sparkjava:spark-core:2.5.5'
    compile 'com.fasterxml.jackson.core:jackson-databind:2.7.4'
    compile 'org.slf4j:slf4j-simple:1.7.21'
    compile 'org.mongodb.morphia:morphia:1.3.2'

    testCompile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
    testCompile('org.jetbrains.spek:spek-api:1.1.0') {
        exclude group: 'org.jetbrains.kotlin'
    }
    testRuntime('org.jetbrains.spek:spek-junit-platform-engine:1.1.0') {
        exclude group: 'org.junit.platform'
        exclude group: 'org.jetbrains.kotlin'
    }
    testCompile 'org.amshove.kluent:kluent:1.14'
}
But when I try to implement a test class like this:
Copy code
object SimpleSpec: Spek({
    describe("a calculator") {
        val calculator = SampleCalculator()

        on("addition") {
            val sum = calculator.sum(2, 4)

            it("should return the result of adding the first number to the second number") {
                assertEquals(6, sum)
            }
        }
    }
})
I'm unable to import Spek classes and methods.