5

我正在尝试使用 specs2,但隐式转换与我从 scala.concurrent.duration._ 导入的转换混合存在问题,有没有办法从范围中排除隐式转换?

import org.specs2.mutable.Specification
import scala.concurrent.duration._

class StatisticsSampleCacheSpec extends Specification {

    val map: Map[Long, Duration] = Map(
        1L -> 5.minute,
        3L -> 3.day,
        5L -> 5.day,
        7L -> 30.day)
}
4

1 回答 1

13

这是很常见的问题,尝试混合org.specs2.time.NoTimeConversions特征:

class StatisticsSampleCacheSpec extends Specification with NoTimeConversions
于 2013-08-14T12:17:03.320 回答