【问题标题】:Error: "package test is not a value" using scalatest FunSpec错误:使用 scalatest FunSpec 的“包测试不是一个值”
【发布时间】:2018-02-16 07:10:44
【问题描述】:

我将测试从WordMatchers 更改为FunSpec,现在无法摆脱以下编译错误的测试:

class SangriaDnbIACDataPipelineTest extends FunSpec {

  test("SangriaDnbIACDataPipeline") {
    val args =

 error: package test is not a value
[ERROR]   test("SangriaDnbIACDataPipeline") {

这是scala 2.11scalatest 3.0.1

【问题讨论】:

  • 你是否将你的包命名为“test”?
  • 查看接受的答案
  • 接受的答案基本上表明您应该使用FunSuite 而不是FunSpec。我假设FunSuite 有一个方法test。但这不是我问的。我问你是否将你的包(或父包之一)命名为“测试”。如果不是这样,那么错误信息就真的很奇怪了,应该在别处报告。
  • 否 - 包不是 test

标签: scala scalatest


【解决方案1】:

我认为您正在寻找 FunSuite 扩展程序:

import org.scalatest.FunSuite

class SangriaDnbIACDataPipelineTest extends FunSuite {

  test("SangriaDnbIACDataPipeline") {
    val args =

testing styles

【讨论】:

    猜你喜欢
    • 2021-05-24
    • 1970-01-01
    • 1970-01-01
    • 2015-03-02
    • 1970-01-01
    • 2021-08-29
    • 1970-01-01
    • 2020-01-27
    • 2012-05-20
    相关资源
    最近更新 更多