0
我想共享數據庫/知識庫,以進行一組測試。我希望它可以用於任何測試套件。我正在使用featureSpecfixture.FeatureSpec/withFixture(OneArgTest)問題
繼文檔之後,我使用了fixture.FeatureSpec。
截至目前我已經定義如下:
trait InteractionKbFixtureTrait { this: fixture.Suite =>
type FixtureParam = InteractionKB
def withFixture(test: OneArgTest): Unit = {
val kb = KbFactory.createKb("", "") // create the fixture
try {
this.withFixture(test.toNoArgTest(kb)) // "loan" the fixture to the test
} finally {
//kb.stop() // clean up the fixture
}
}
}其次
class ExampleSpec extends fixture.FeatureSpec with InteractionKbFixtureTrait {
}
我收到以下錯誤
:在特質
類型覆蓋方法withFixture套件類型(測試:ExampleSpec.this.OneArgTest)org.scalatest.Outcome; 方法與性質InteractionKbFixtureTrait類型(測試:ExampleSpec.this.OneArgTest)單位具有不兼容類型InteractionKbFixtureTrait.scala
任何幫助嗎?