spec2

    4熱度

    1回答

    我找到了一些答案,但沒有任何工作適合我。 試圖模擬Apache Shiro主題接口登錄方法返回void。 接口: void login(AuthenticationToken token) throws AuthenticationException; 我曾嘗試: #1 val subject = mock[Subject] doNothing().when(subject

    1熱度

    1回答

    如何聲明Spec2(Unit-Style)中的依賴關係? 例子: object MySpec extends Specification { firstDo MyOtherSpec } 所以MyOtherSpec的測試之前MySpec的測試執行!

    3熱度

    1回答

    Scala的測試代碼: import play.api.test._ import scala._ import org.specs2.execute.Result object ThrowTest extends PlaySpecification { "throwA" should { "catch the exception test1" in {

    2熱度

    1回答

    我想驗證業務邏輯是否將預期的user對象傳遞給dao,但我無法確定如何爲它編寫自定義參數匹配器。 case class User(name:String, random: Double) 裏面包含了double領域,我需要做的是一些特殊的比較: "user" should { "be saved" in { val dao = new UserDao() da

    0熱度

    1回答

    我有以下SPEC2測試 import akka.testkit._ import akka.actor.ActorSystem import com.github.nfldb.config.{NflDbApiActorSystemConfig, NflDbApiDbConfigTest} import org.scalatest.MustMatchers import org.specs2

    1熱度

    1回答

    我對使用sbt運行的spec2使用者的Pact JVM存在問題。 - 什麼可能是錯誤的? - 我不生成任何協議文件。 給出: 與依賴 「au.com.dius」 %% 「協議,JVM的消費specs2」 % 「3.2.11」 SBT項目「 org.specs2" %% 「specs2-JUnit的」 % 「3.3.1」 我有規範類: import java.util.concurrent.Time

    0熱度

    1回答

    我試圖測試波紋管使用播放2.4.2,規格2, " test response Returns a json Array" in new WithApplication { val response = route(FakeRequest(GET, "/myservice/xx")).get // ??? test response is a json array } 什