3

When I compile my specification, the compiler tells me

"error: value s2 is not a member of StringContext"

The salient portion of my specification class is:

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}
                                                                """
  ...

What is causing the error, and how can I correct it?

I'm using Specs2 (artifact specs2_2.10) version 1.14.

4

2 回答 2

3

您需要使用更高版本的specs2specs2-2.0-RC1specs2-2.0-RC2-SNAPSHOT

于 2013-05-24T01:07:54.870 回答
0

For the benefit of others reading this, I put the following into my pom.xml:

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

...along with the repository entry for snapshots:

    <!--
    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>
于 2013-05-24T02:54:18.080 回答