src/main/scala/Testing.scala
package common
object Add1Method {
def main(args: Array[String]) = 100+2
}project/build.sbt
name := "Foo"
version := "1.0"
scalaVersion := "2.10.2"
libraryDependencies += "org.scalatest" % "scalatest_2.10" % "1.9.1" % "test"
resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"
resolvers += "Sonatype Releases" at "http://oss.sonatype.org/content/repositories/releases"src/test/scala/Test.scala
package test
import common.Testing
import org.scalatest._
class TestAdd1 extends FlatSpec with Matchers {
"Adding 1 to Array(1)" should "return in Some(2)" in {
val result = Add1Method.main(Array("asdf"))
assert(result == 102)
}
}But, when I run test from SBT, the following 4 compile-time errors:
[error] Test.scala:4: object scalatest is not a member of package org
[error] import org.scalatest._
[error] ^
[error] Test.scala:6: not found: type FlatSpec
[error] class Test extends FlatSpec with Matchers {
[error] ^
[error] Test.scala:6: not found: type Matchers
[error] class Test extends FlatSpec with Matchers {
[error] ^
[error] Test.scala:8: value should is not a member of String
[error] "Adding 1 to Array(1)" should "return in Some(2)" in {
[error] ^
[error] four errors foundNote that I tried the suggested answer in SBT not finding scalatest for scala 2.10.1 without success.
I also saw the same compile-time errors with:
libraryDependencies += "org.scalatest" % "scalatest_2.10" % "2.0" % "test"
--
You received this message because you are subscribed to the Google
Groups "scalatest-users" group.
To post to this group, send email to scalate...@googlegroups.com
To unsubscribe from this group, send email to
scalatest-use...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/scalatest-users?hl=en
ScalaTest itself, and documentation, is available here:
http://www.artima.com/scalatest
---
You received this message because you are subscribed to the Google Groups "scalatest-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalatest-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.