2017-09-15 3 views
0

이 예제 코드를 실행하면 "on"액션의 모든 코드가 Android Studio에서 실행되지 않습니다. 왜 그런지 알아? 없어진 물건 있어요?Spek on action이 실행되지 않는 이유는 무엇입니까?

import org.jetbrains.spek.api.Spek 
import org.jetbrains.spek.api.dsl.describe 
import org.jetbrains.spek.api.dsl.given 
import org.jetbrains.spek.api.dsl.it 
import org.jetbrains.spek.api.dsl.on 

@RunWith(JUnitPlatform::class) class SpekTest : Spek({ 
    val x = 2 
    val y = 3 

    given("x = $x and y = $y") { 
     val sum = x + y 

     on ("why does this not run?") { 
      it("should be that x + y = 5") { 
       assertEquals(5, sum) 
      } 

      it("should be that x - y = -1") { 
       val subtract = x - y 
       assertEquals(-111, subtract) 
      } 
     } 

    } }) 

답변

0

하는 것으로 스펙의 버전을 업데이트해야합니다

testCompile group: 'org.jetbrains.spek', name: 'spek-api', version: '1.1.4' 
testCompile group: 'org.jetbrains.spek', name: 'spek-junit-platform-engine', version: '1.1.4'