Spek: Please Update Intellij Plugin

Created on 16 Aug 2018  路  4Comments  路  Source: spekframework/spek

Hello!

I have been trying to get Spek to work for the past couple days and finally got very close to getting everything working together. However I believe the last thing that doesn't seem to be working is the Spek plugin. I'm using Kotlin 1.2.60, Gradle 4.9, Intellij 2018.1 community edition, my gradle build file looks like the following:

plugins {
    id 'org.jetbrains.kotlin.jvm' version '1.2.60'
    id 'org.jetbrains.spek.spek-idea-plugin'
}

repositories {
    mavenCentral()
    maven { url = "https://dl.bintray.com/spekframework/spek-dev/" }
}

test {
    useJUnitPlatform {
        includeEngines 'spek2'
    }
}

dependencies {
    compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
    compile "org.jetbrains.kotlin:kotlin-test"

    implementation "org.jetbrains.kotlin:kotlin-stdlib"

    testImplementation ("org.spekframework.spek2:spek-dsl-jvm:2.0.0-alpha.1")  {
        exclude group: 'org.jetbrains.kotlin'
    }
    testRuntimeOnly ('org.spekframework.spek2:spek-runner-junit5:2.0.0-alpha.1') {
        exclude group: 'org.junit.platform'
        exclude group: 'org.jetbrains.kotlin'
    }

    testRuntimeOnly "org.jetbrains.kotlin:kotlin-reflect"

    testCompile 'org.junit.jupiter:junit-jupiter-api:5.2.0'
}

compileKotlin {
    kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
    kotlinOptions.jvmTarget = "1.8"
}

And yet when I run JUnit tests the response is "No test found"

Everything else is compiling just fine, my file structure has a main and a test directory, in the VM options I have -ea selected which was mentioned at some point in the various documentation that is out there.

I very much want to use spek instead of junit5. It fits my brain better, but the documentation needs a lot of work. The fact that the repository still isn't in the documentation, I had to find it in one of the issues, it wasn't clear that I had to replace 2.x.x with 2.0.0-alpha.1 I had to find that I had to include testCompile 'org.junit.jupiter:junit-jupiter-api:5.2.0' from the junit5 documentation.

If it's not the plugin I'm happy to get any help to figure out what is going on, but the small amount I can find suggests it's the plugin.

Thanks for input!

bug

All 4 comments

The 'No test found' issue is Android Studios way to tell us it hates us.

Been experiencing it periodically for around half a year on a project not using Spek. Pretty sure it's not the plugin.

@Benbyday what plugin version do you have? I think you may have pulled in the plugin for IJ. Can you try downloading the plugin manually from here: https://plugins.jetbrains.com/plugin/10915-spek-framework. Choose the AS version.

Also why do you need testCompile 'org.junit.jupiter:junit-jupiter-api:5.2.0'? Are you using @RunWith(...)?

I've just installed the Plugin for AS with the link you provided and it works fabulously. My gradle configuration:

test {
  useJUnitPlatform {
    includeEngines 'spek2'
  }
}

dependencies {
  testImplementation deps.test.spek
  testImplementation deps.assertj3
}

Hey, since I have updated my intellij version. The plugin don't work anymore. Could we get a update on this?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

snowe2010 picture snowe2010  路  5Comments

windyboy picture windyboy  路  3Comments

jcornaz picture jcornaz  路  4Comments

svenjacobs picture svenjacobs  路  6Comments

mtrewartha picture mtrewartha  路  5Comments