The Artima Developer Community
Sponsored Link

Programming in Scala Forum
error: value scalatest is not a member of package org

2 replies on 1 page. Most recent reply: Jul 20, 2010 5:22 PM by Bill Venners

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
Larry K

Posts: 4
Nickname: ldk
Registered: Aug, 2009

error: value scalatest is not a member of package org Posted: Sep 16, 2009 7:45 PM
Reply to this message Reply
Advertisement
Seems I need a tutorial for the chapter 14 tutorial. I always get

error: value scalatest is not a member of package org

when I do
import org.scalatest.Suite as in Listing 14.3

I went to http://www.scala-lang.org/downloads and did
sbaz install scala-test
That didn't help.

I went to http://www.artima.com/scalatest/ and downloaded scalatest-0.9.5.zip and extracted into its own directory. Set my path variable and classpath variable to search this directoy. Still get the same error!

I bet the solution is probably easy, but it seems this book that is supposed to be a "tutorial" has skipped a step or two for this chapter.

What do I need to do?


Erik Galicki

Posts: 1
Nickname: erikjg
Registered: Jul, 2010

Re: error: value scalatest is not a member of package org Posted: Jul 3, 2010 8:45 AM
Reply to this message Reply
The following actions brought me success with scalatest-1.0:

compile ElementSuite.scala (the file containing the code in Listing 14.3) with scalac -classpath $relative-path-to/scalatest-1.0.jar ElementSuite.scala. E.g. I used scalac -classpath ../scala/scalatest-1.0/scalatest-1.0.jar ElementSuite.scala

invoke the scala interpreter with the same classpath argument

use a :load command to load your ElementSuite.scala within the compiler

run the command (new ElementSuite).execute() at the interpreter

Bill Venners

Posts: 2284
Nickname: bv
Registered: Jan, 2002

Re: error: value scalatest is not a member of package org Posted: Jul 20, 2010 5:22 PM
Reply to this message Reply
Just to clarify, I don't know what scala-test from sbaz will give you. It isn't ScalaTest though. To install ScalaTest, follow the instructions on scalatest.org. I think your probably was simply that there was some typo in the classpath when you compiled. You simply need to include the jar file for ScalaTest in your classpath when you compile to get rid of that error.

Flat View: This topic has 2 replies on 1 page
Topic: Again About Traits in Scala Previous Topic   Next Topic Topic: Knowing Scala

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use