【发布时间】:2016-07-12 00:36:06
【问题描述】:
在下面更新了完整的代码和孤立的问题
如果我有以下代码(scalatest 2.2.6、WordSpec、scala 2.11.8),我目前正在使用 intellij 14 Ultimate:
"this code" when {
"doing this" should {
"know what is true" in {
true shouldBe true
}
"know what is false" in {
false shouldBe false
}
}
在intellij idea Ultimate 14(无需额外配置)中,如果我右键单击"know what is true" in {这一行,然后选择run test,它只会运行这一项测试
我刚刚升级到 2016.1 终极版(并尝试了 2016.2 RC),但这不再有效。如果我只点击一个测试,它只会运行文件中的所有测试。
如何在 2016.x 中解决此问题?
在下面编辑
如果我不使用标签,它只允许我运行单个选定的测试,但如果我使用标签,即使我选择运行特定的测试,它总是运行文件中的所有测试 - 这有效在 Intellij 14 中很好。
object TestTag extends Tag("com.me.test.tag")
class TestingSpec extends WordSpec with Matchers {
"these tests allow single test to run" when {
"doing this" should {
"know what is true" in {
true shouldBe true
}
"know what is false" in {
false shouldBe false
}
}
}
"these tests DO NOT allow single test to run" when {
"doing this" should {
"know what is true" taggedAs TestTag in {
true shouldBe true
}
"know what is false" taggedAs TestTag in {
false shouldBe false
}
}
}
}
【问题讨论】:
标签: scala intellij-idea scalatest