Specs2类中未解析的符号s2

Specs2类中未解析的符号s2,specs2,Specs2,当我编译我的规范时,编译器告诉我 “错误:值s2不是StringContext的成员” 我的规范类的突出部分是: import org.specs2._ import specification._ import mock._ class EnterpriseDirectoryActionSpec extends Specification { def is = s2""" An enterprise directory action should provide enabled fiel

当我编译我的规范时,编译器告诉我

“错误:值s2不是StringContext的成员”

我的规范类的突出部分是:

import org.specs2._
import specification._
import mock._

class EnterpriseDirectoryActionSpec extends Specification { def is = s2"""
  An enterprise directory action should provide enabled fields
    after a call to doDefault                                   ${c().e1}
    after a call to doSearchPrevious                            ${c().e2}
    after a call to doSearchNext                                ${c().e3}
    after a call to doExecuteSearch                             ${c().e4}
                                                                """
  ...
错误的原因是什么?我如何更正它


我正在使用Specs2(工件Specs2_2.10)版本1.14。

您需要使用更高版本的Specs2:或

为了让其他阅读本文的人受益,我在pom.xml中添加了以下内容:

    <dependency>
        <groupId>org.specs2</groupId>
        <artifactId>specs2_2.10</artifactId>
        <version>2.0-RC2-SNAPSHOT</version>
        <scope>test</scope>
    </dependency>

org.specs2
规格2_2.10
2.0-RC2-SNAPSHOT
测试
…以及快照的存储库条目:

    <!--
    We need this repository in order to have access to a snapshot version of
    the Specs2 testing library for Scala. In particular, the snapshot version
    includes support for using string interpolation in test specifications.
    -->
    <repository>
        <id>oss.sonatype.org</id>
        <name>snapshots</name>
        <url>http://oss.sonatype.org/content/repositories/snapshots</url>
    </repository>

oss.sonatype.org
快照
http://oss.sonatype.org/content/repositories/snapshots

成功!谢谢你的迅速回复,埃里克。